public abstract class SynonymDictionary extends DictionaryBase implements Iterable<String>
Learn more
ErrorOccurred
Modifier | Constructor and Description |
---|---|
protected |
SynonymDictionary(String filePath,
boolean saveOnChange)
Initializes a new instance of the
SynonymDictionary class. |
Modifier and Type | Method and Description |
---|---|
abstract void |
addRange(Iterable<String[]> synonyms)
Adds the specified collection of synonym groups to this instance of the
SynonymDictionary . |
abstract void |
addRange(String[][] synonyms)
Adds the specified collection of synonym groups to this instance of the
SynonymDictionary . |
abstract void |
clear()
Removes all words from this
SynonymDictionary object. |
abstract String[][] |
getAllSynonymGroups()
Gets all groups of synonyms contained in this dictionary.
|
abstract int |
getCount()
Gets the number of words contained in this
SynonymDictionary . |
abstract String[][] |
getSynonymGroups(String word)
Gets all groups of synonyms to which the specified word belongs.
|
abstract String[] |
getSynonyms(String word)
Gets the synonyms for the specified word.
|
abstract Iterator<String> |
iterator()
Returns an iterator that iterates through the collection.
|
copyFrom, export, exportDictionary, getFilePath, getFilePathStatic, getStandardFileName, getStandardFileNameStatic, import_, importDictionary, load, loadDefault, loadInternalStatic, merge, mergeInternalStatic, notifyChanged, save, setFilePath
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
protected SynonymDictionary(String filePath, boolean saveOnChange)
Initializes a new instance of the SynonymDictionary
class.
filePath
- The file name.saveOnChange
- The save on change flag.public abstract int getCount()
Gets the number of words contained in this SynonymDictionary
.
SynonymDictionary
.public abstract void addRange(Iterable<String[]> synonyms)
Adds the specified collection of synonym groups to this instance of the SynonymDictionary
.
synonyms
- The collection of synonym groups to add to the dictionary.public abstract void addRange(String[][] synonyms)
Adds the specified collection of synonym groups to this instance of the SynonymDictionary
.
synonyms
- The collection of synonym groups to add to the dictionary.public abstract void clear()
Removes all words from this SynonymDictionary
object.
public abstract String[] getSynonyms(String word)
Gets the synonyms for the specified word. The resulting array does not contain the original word.
word
- The word to suggest the synonyms.SynonymDictionary
object does not contain the specified word.public abstract String[][] getSynonymGroups(String word)
Gets all groups of synonyms to which the specified word belongs.
word
- The word for getting groups of synonyms.public abstract String[][] getAllSynonymGroups()
Gets all groups of synonyms contained in this dictionary.