|
||||||||||
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.SpellDictionaryHashMap
public class SpellDictionaryHashMap
The SpellDictionaryHashMap holds the dictionary
This class is thread safe. Derived classes should ensure that this preserved. There are many open source dictionary files. For just a few see: http://wordlist.sourceforge.net/ This dictionary class reads words one per line. Make sure that your word list is formatted in this way (most are).
Constructor Summary | |
---|---|
SpellDictionaryHashMap()
Dictionary Constructor. |
|
SpellDictionaryHashMap(java.io.File wordList)
Dictionary Convenience Constructor. |
|
SpellDictionaryHashMap(java.io.File wordList,
java.io.File phonetic)
Dictionary constructor that uses an aspell phonetic file to build the transformation table. |
|
SpellDictionaryHashMap(java.io.File wordList,
java.io.File phonetic,
java.lang.String phoneticEncoding)
Dictionary constructor that uses an aspell phonetic file to build the transformation table. |
|
SpellDictionaryHashMap(java.io.File wordList,
java.io.Reader phonetic)
Constructor for the SpellDictionaryHashMap object |
|
SpellDictionaryHashMap(java.io.Reader wordList)
Dictionary Constructor. |
|
SpellDictionaryHashMap(java.io.Reader wordList,
java.io.Reader phonetic)
Dictionary constructor that uses an aspell phonetic file to build the transformation table. |
Method Summary | |
---|---|
void |
addDictionary(java.io.File wordList)
Add words from a file to existing dictionary hashmap. |
void |
addDictionary(java.io.Reader wordList)
Adds a feature to the Dictionary attribute of the SpellDictionaryHashMap object |
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. |
boolean |
isCorrect(java.lang.String word)
Returns true if the word is correctly spelled against the current word list. |
Methods inherited from class com.swabunga.spell.engine.SpellDictionaryASpell |
---|
getCode, getSuggestions |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpellDictionaryHashMap() throws java.io.IOException
java.io.IOException
- Description of the Exceptionpublic SpellDictionaryHashMap(java.io.Reader wordList) throws java.io.IOException
wordList
- Description of the Parameter
java.io.IOException
- Description of the Exceptionpublic SpellDictionaryHashMap(java.io.File wordList) throws java.io.FileNotFoundException, java.io.IOException
wordList
- Description of the Parameter
java.io.FileNotFoundException
- Description of the Exception
java.io.IOException
- Description of the Exceptionpublic SpellDictionaryHashMap(java.io.File wordList, java.io.File phonetic) throws java.io.FileNotFoundException, java.io.IOException
wordList
- Description of the Parameterphonetic
- Description of the Parameter
java.io.FileNotFoundException
- Description of the Exception
java.io.IOException
- Description of the Exceptionpublic SpellDictionaryHashMap(java.io.File wordList, java.io.Reader phonetic) throws java.io.FileNotFoundException, java.io.IOException
wordList
- Description of the Parameterphonetic
- Description of the Parameter
java.io.FileNotFoundException
- Description of the Exception
java.io.IOException
- Description of the Exceptionpublic SpellDictionaryHashMap(java.io.File wordList, java.io.File phonetic, java.lang.String phoneticEncoding) throws java.io.FileNotFoundException, java.io.IOException
wordList
- Description of the Parameterphonetic
- Description of the ParameterphoneticEncoding
- Description of the Parameter
java.io.FileNotFoundException
- Description of the Exception
java.io.IOException
- Description of the Exceptionpublic SpellDictionaryHashMap(java.io.Reader wordList, java.io.Reader phonetic) throws java.io.IOException
wordList
- Description of the Parameterphonetic
- Description of the Parameter
java.io.IOException
- Description of the ExceptionMethod Detail |
---|
public void addDictionary(java.io.File wordList) throws java.io.FileNotFoundException, java.io.IOException
Note that adding a dictionary does not affect the target dictionary file for the addWord method. That is, addWord() continues to make additions to the dictionary file specified in createDictionary()
wordList
- A File object that contains the words, on word per line.
java.io.FileNotFoundException
java.io.IOException
public void addDictionary(java.io.Reader wordList) throws java.io.IOException
wordList
- The feature to be added to the Dictionary attribute
java.io.IOException
- Description of the Exceptionpublic void addWord(java.lang.String word)
This needs to be made thread safe (synchronized)
word
- The feature to be added to the Word attributepublic java.util.List getWords(java.lang.String code)
code
- Description of the Parameter
public boolean isCorrect(java.lang.String word)
isCorrect
in interface SpellDictionary
isCorrect
in class SpellDictionaryASpell
word
- Description of the Parameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |