Package com.gengoai.hermes.lexicon
Interface WordList
-
- 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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
contains(@NonNull HString string)
Is theHString
contained in the WordListboolean
contains(String string)
Is the String contained in the WordListint
size()
Number of words in the list-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
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 theHString
contained in the WordList
-
size
int size()
Number of words in the list- Returns:
- the number of words in the list
-
-