Package smile.nlp.dictionary
Class SimpleDictionary
java.lang.Object
smile.nlp.dictionary.SimpleDictionary
- All Implemented Interfaces:
Dictionary
A simple implementation of dictionary interface.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
SimpleDictionary
Constructor.- Parameters:
resource
- the file name of dictionary. The file should be in plain text, in which each line is a word.
-
-
Method Details
-
contains
Description copied from interface:Dictionary
Returns true if this dictionary contains the specified word.- Specified by:
contains
in interfaceDictionary
- Parameters:
word
- the query word.- Returns:
- true if this dictionary contains the specified word.
-
size
public int size()Description copied from interface:Dictionary
Returns the number of words in this dictionary.- Specified by:
size
in interfaceDictionary
- Returns:
- the number of words in this dictionary.
-
iterator
Description copied from interface:Dictionary
Returns an iterator over the words in this dictionary.- Specified by:
iterator
in interfaceDictionary
- Returns:
- the iterator.
-