Interface ILexicon

All Superinterfaces:
java.lang.Iterable<java.lang.String>
All Known Implementing Classes:
SimpleLexicon, TrieLexicon

public interface ILexicon
extends java.lang.Iterable<java.lang.String>


Method Summary
 java.util.Iterator<java.lang.String> iterator()
          Return an iterator over all words stored in the lexicon.
 void load(java.util.ArrayList<java.lang.String> list)
          Clear a lexicon and store all values read from the list for subsequent querying.
 void load(java.util.Scanner s)
          Clear a lexicon and store all values read from the scanner for subsequent querying.
 int size()
          Returns number of words stored in the lexicon (as from last call to load, for example).
 LexStatus wordStatus(java.lang.String s)
          Similar to wordStatus that takes a StringBuilder parameter, but works with a String.
 LexStatus wordStatus(java.lang.StringBuilder s)
          Returns value specifying whether is is in the lexicon: WORD, is the prefix of a word in the lexicon: PREFIX, or is not a prefix and not a word: NOT_WORD.
 

Method Detail

load

void load(java.util.Scanner s)
Clear a lexicon and store all values read from the scanner for subsequent querying.

Parameters:
s - is the source of words for the lexicon

load

void load(java.util.ArrayList<java.lang.String> list)
Clear a lexicon and store all values read from the list for subsequent querying.

Parameters:
list - is the source of words for the lexicon

wordStatus

LexStatus wordStatus(java.lang.StringBuilder s)
Returns value specifying whether is is in the lexicon: WORD, is the prefix of a word in the lexicon: PREFIX, or is not a prefix and not a word: NOT_WORD. See LexStatus

Parameters:
s - represents the word/sequence queried
Returns:
status of s as to how it appears in lexicon

wordStatus

LexStatus wordStatus(java.lang.String s)
Similar to wordStatus that takes a StringBuilder parameter, but works with a String.

Parameters:
s - is the string queried
Returns:
status of s as to how it appears in lexicon

iterator

java.util.Iterator<java.lang.String> iterator()
Return an iterator over all words stored in the lexicon.

Specified by:
iterator in interface java.lang.Iterable<java.lang.String>
Returns:
an iterator over the words in the lexicon

size

int size()
Returns number of words stored in the lexicon (as from last call to load, for example).

Returns:
number of words in the lexicon