com.swabunga.spell.engine

Class SpellDictionaryCachedDichoDisk

public class SpellDictionaryCachedDichoDisk extends SpellDictionaryDichoDisk

Yet another SpellDictionary this one is based on Damien Guillaume's Diskbased dictionary but adds a cache to try to improve abit on performance.

Version: 0.01

Author: Robert Gustavsson

Field Summary
static intcodes
static inthits
static StringJAZZY_DIR
static StringPRE_CACHE_FILE_EXT
Constructor Summary
SpellDictionaryCachedDichoDisk(File wordList)
Dictionary Convienence Constructor.
SpellDictionaryCachedDichoDisk(File wordList, String encoding)
Dictionary Convienence Constructor.
SpellDictionaryCachedDichoDisk(File wordList, File phonetic)
Dictionary constructor that uses an aspell phonetic file to build the transformation table.
SpellDictionaryCachedDichoDisk(File wordList, File phonetic, String encoding)
Dictionary constructor that uses an aspell phonetic file to build the transformation table.
Method Summary
voidaddWord(String word)
Add a word permanantly to the dictionary (and the dictionary file).
voidclearCache()
Clears the cache.
ListgetWords(String code)
Returns a list of strings (words) for the code.
voidsaveCache()
Saves the current cache to file.

Field Detail

codes

public static int codes

hits

public static int hits

JAZZY_DIR

public static final String JAZZY_DIR

PRE_CACHE_FILE_EXT

public static final String PRE_CACHE_FILE_EXT

Constructor Detail

SpellDictionaryCachedDichoDisk

public SpellDictionaryCachedDichoDisk(File wordList)
Dictionary Convienence Constructor.

SpellDictionaryCachedDichoDisk

public SpellDictionaryCachedDichoDisk(File wordList, String encoding)
Dictionary Convienence Constructor.

SpellDictionaryCachedDichoDisk

public SpellDictionaryCachedDichoDisk(File wordList, File phonetic)
Dictionary constructor that uses an aspell phonetic file to build the transformation table.

SpellDictionaryCachedDichoDisk

public SpellDictionaryCachedDichoDisk(File wordList, File phonetic, String encoding)
Dictionary constructor that uses an aspell phonetic file to build the transformation table.

Method Detail

addWord

public void addWord(String word)
Add a word permanantly to the dictionary (and the dictionary file). not implemented !

clearCache

public void clearCache()
Clears the cache.

getWords

public List getWords(String code)
Returns a list of strings (words) for the code.

saveCache

public void saveCache()
Saves the current cache to file.