Package com.swabunga.spell.engine
Class SpellDictionaryCachedDichoDisk
java.lang.Object
com.swabunga.spell.engine.SpellDictionaryASpell
com.swabunga.spell.engine.SpellDictionaryDichoDisk
com.swabunga.spell.engine.SpellDictionaryCachedDichoDisk
- All Implemented Interfaces:
SpellDictionary
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
FieldsFields inherited from class com.swabunga.spell.engine.SpellDictionaryASpell
tf
-
Constructor Summary
ConstructorsConstructorDescriptionSpellDictionaryCachedDichoDisk
(File wordList) 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.SpellDictionaryCachedDichoDisk
(File wordList, String encoding) Dictionary Convienence Constructor. -
Method Summary
Methods inherited from class com.swabunga.spell.engine.SpellDictionaryASpell
getCode, getSuggestions, getSuggestions, isCorrect
-
Field Details
-
hits
public static int hits -
codes
public static int codes -
JAZZY_DIR
- See Also:
-
PRE_CACHE_FILE_EXT
- See Also:
-
-
Constructor Details
-
SpellDictionaryCachedDichoDisk
Dictionary Convienence Constructor.- Throws:
FileNotFoundException
IOException
-
SpellDictionaryCachedDichoDisk
public SpellDictionaryCachedDichoDisk(File wordList, String encoding) throws FileNotFoundException, IOException Dictionary Convienence Constructor.- Throws:
FileNotFoundException
IOException
-
SpellDictionaryCachedDichoDisk
public SpellDictionaryCachedDichoDisk(File wordList, File phonetic) throws FileNotFoundException, IOException Dictionary constructor that uses an aspell phonetic file to build the transformation table.- Throws:
FileNotFoundException
IOException
-
SpellDictionaryCachedDichoDisk
public SpellDictionaryCachedDichoDisk(File wordList, File phonetic, String encoding) throws FileNotFoundException, IOException Dictionary constructor that uses an aspell phonetic file to build the transformation table.- Throws:
FileNotFoundException
IOException
-
-
Method Details
-
addWord
Add a word permanantly to the dictionary (and the dictionary file). not implemented !- Specified by:
addWord
in interfaceSpellDictionary
- Overrides:
addWord
in classSpellDictionaryDichoDisk
- Parameters:
word
- The word to add.
-
clearCache
public void clearCache()Clears the cache. -
getWords
Returns a list of strings (words) for the code.- Overrides:
getWords
in classSpellDictionaryDichoDisk
- Parameters:
code
- The phonetic code common to the list of words- Returns:
- A list of words having the same phonetic code
-
saveCache
Saves the current cache to file.- Throws:
IOException
-