public class SpellDictionaryCachedDichoDisk extends SpellDictionaryDichoDisk
SpellDictionary
this one is based on Damien Guillaume's
Diskbased dictionary but adds a cache to try to improve abit on performance.Modifier and Type | Field and Description |
---|---|
static int |
codes |
static int |
hits |
static java.lang.String |
JAZZY_DIR |
static java.lang.String |
PRE_CACHE_FILE_EXT |
tf
Constructor and Description |
---|
SpellDictionaryCachedDichoDisk(java.io.File wordList)
Dictionary Convienence Constructor.
|
SpellDictionaryCachedDichoDisk(java.io.File wordList,
java.io.File phonetic)
Dictionary constructor that uses an aspell phonetic file to
build the transformation table.
|
SpellDictionaryCachedDichoDisk(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.
|
SpellDictionaryCachedDichoDisk(java.io.File wordList,
java.lang.String encoding)
Dictionary Convienence Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addWord(java.lang.String word)
Add a word permanantly to the dictionary (and the dictionary file).
|
void |
clearCache()
Clears the cache.
|
java.util.List |
getWords(java.lang.String code)
Returns a list of strings (words) for the code.
|
void |
saveCache()
Saves the current cache to file.
|
getCode, getSuggestions, getSuggestions, isCorrect
public static int hits
public static int codes
public static final java.lang.String JAZZY_DIR
public static final java.lang.String PRE_CACHE_FILE_EXT
public SpellDictionaryCachedDichoDisk(java.io.File wordList) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public SpellDictionaryCachedDichoDisk(java.io.File wordList, java.lang.String encoding) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public SpellDictionaryCachedDichoDisk(java.io.File wordList, java.io.File phonetic) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public SpellDictionaryCachedDichoDisk(java.io.File wordList, java.io.File phonetic, java.lang.String encoding) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public void addWord(java.lang.String word)
addWord
in interface SpellDictionary
addWord
in class SpellDictionaryDichoDisk
word
- The word to add.public void clearCache()
public java.util.List getWords(java.lang.String code)
getWords
in class SpellDictionaryDichoDisk
code
- The phonetic code common to the list of wordspublic void saveCache() throws java.io.IOException
java.io.IOException