Interface WordList

  • All Superinterfaces:
    Iterable<String>
    All Known Implementing Classes:
    DiskLexicon, Lexicon, PersistentLexicon, SimpleWordList, TrieLexicon, TrieWordList

    public interface WordList
    extends Iterable<String>

    Word lists provide a set like interface to set of vocabulary items. Implementations of WordList may implement the PrefixSearchable interface allowing prefix matching. Word lists are loaded from plain text files with "#" at the beginning of a line denoting a comment. Whereas lexicons provide a robust way to match and label HStrings, _WordList_s provide a simple means of determining if a word/phrase is defined.

    Note that convention states that if the first line of a word list is a comment stating "case-insensitive" then loading of that word list will result in all words being lower-cased.

    Author:
    David B. Bracewell
    • Method Detail

      • contains

        boolean contains​(String string)
        Is the String contained in the WordList
        Parameters:
        string - the string to lookup
        Returns:
        True if the string is in the WordList, False otherwise
      • contains

        default boolean contains​(@NonNull
                                 @NonNull HString string)
        Is the HString contained in the WordList
        Parameters:
        string - the HString to lookup
        Returns:
        True if the HString is in the WordList, False otherwise
      • size

        int size()
        Number of words in the list
        Returns:
        the number of words in the list