public abstract class HomophoneDictionary extends DictionaryBase implements Iterable<String>
Learn more
ErrorOccurred
Modifier | Constructor and Description |
---|---|
protected |
HomophoneDictionary(String filePath,
boolean saveOnChange)
Initializes a new instance of the
HomophoneDictionary class. |
Modifier and Type | Method and Description |
---|---|
abstract void |
addRange(Iterable<String[]> homophones)
Adds the specified collection of homophone groups to this instance of the
HomophoneDictionary . |
abstract void |
addRange(String[][] homophones)
Adds the specified collection of homophone groups to this instance of the
HomophoneDictionary . |
abstract void |
clear()
Removes all words from a
HomophoneDictionary object. |
abstract String[][] |
getAllHomophoneGroups()
Gets all groups of homophones contained in this dictionary.
|
abstract int |
getCount()
Gets the number of words contained in this
HomophoneDictionary . |
abstract String[][] |
getHomophoneGroups(String word)
Gets all groups of homophones to which the specified word belongs.
|
abstract String[] |
getHomophones(String word)
Gets the homophones 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 HomophoneDictionary(String filePath, boolean saveOnChange)
Initializes a new instance of the HomophoneDictionary
class.
filePath
- The file name.saveOnChange
- The save on change flag.public abstract int getCount()
Gets the number of words contained in this HomophoneDictionary
.
public abstract void addRange(Iterable<String[]> homophones)
Adds the specified collection of homophone groups to this instance of the HomophoneDictionary
.
homophones
- The collection of homophone groups to add to the dictionary.public abstract void addRange(String[][] homophones)
Adds the specified collection of homophone groups to this instance of the HomophoneDictionary
.
homophones
- The collection of homophone groups to add to the dictionary.public abstract void clear()
Removes all words from a HomophoneDictionary
object.
public abstract String[] getHomophones(String word)
Gets the homophones for the specified word. The resulting array does not contain the original word.
word
- The word to suggest the homophones.HomophoneDictionary
object does not contain the specified word.public abstract String[][] getHomophoneGroups(String word)
Gets all groups of homophones to which the specified word belongs.
word
- The word for getting groups of homophones.public abstract String[][] getAllHomophoneGroups()
Gets all groups of homophones contained in this dictionary.