|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.swabunga.spell.engine.SpellDictionaryASpell
com.swabunga.spell.engine.SpellDictionaryDichoDisk
Another implementation of SpellDictionary
that doesn't cache any words in memory. Avoids the huge
footprint of SpellDictionaryHashMap
at the cost of relatively minor latency. A future version
of this class that implements some caching strategies might be a good idea in the future, if there's any
demand for it.
This implementation requires a special dictionary file, with "code*word" lines sorted by code.
It's using a dichotomy algorithm to search for words in the dictionary
Field Summary |
Fields inherited from class com.swabunga.spell.engine.SpellDictionaryASpell |
tf |
Constructor Summary | |
SpellDictionaryDichoDisk(java.io.File wordList)
Dictionary Convienence Constructor. |
|
SpellDictionaryDichoDisk(java.io.File wordList,
java.io.File phonetic)
Dictionary constructor that uses an aspell phonetic file to build the transformation table. |
|
SpellDictionaryDichoDisk(java.io.File wordList,
java.io.File phonetic,
java.lang.String encoding)
Dictionary constructor that uses an aspell phonetic file to build the transformation table. |
|
SpellDictionaryDichoDisk(java.io.File wordList,
java.lang.String encoding)
Dictionary Convienence Constructor. |
Method Summary | |
void |
addWord(java.lang.String word)
Add a word permanantly to the dictionary (and the dictionary file). |
java.util.List |
getWords(java.lang.String code)
Returns a list of strings (words) for the code. |
Methods inherited from class com.swabunga.spell.engine.SpellDictionaryASpell |
getCode, getSuggestions, isCorrect |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SpellDictionaryDichoDisk(java.io.File wordList) throws java.io.FileNotFoundException, java.io.IOException
public SpellDictionaryDichoDisk(java.io.File wordList, java.lang.String encoding) throws java.io.FileNotFoundException, java.io.IOException
public SpellDictionaryDichoDisk(java.io.File wordList, java.io.File phonetic) throws java.io.FileNotFoundException, java.io.IOException
public SpellDictionaryDichoDisk(java.io.File wordList, java.io.File phonetic, java.lang.String encoding) throws java.io.FileNotFoundException, java.io.IOException
Method Detail |
public void addWord(java.lang.String word)
public java.util.List getWords(java.lang.String code)
getWords
in class SpellDictionaryASpell
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |