com.swabunga.spell.engine
Class SpellDictionaryASpell
java.lang.Object
|
+--com.swabunga.spell.engine.SpellDictionaryASpell
- All Implemented Interfaces:
- SpellDictionary
- Direct Known Subclasses:
- GenericSpellDictionary, SpellDictionaryDichoDisk, SpellDictionaryDisk, SpellDictionaryHashMap
- public abstract class SpellDictionaryASpell
- extends java.lang.Object
- implements SpellDictionary
Container for various methods that any SpellDictionary
will use.
Based on the original Jazzy aspell port.
Field Summary |
protected Transformator |
tf
The reference to a Transformator, used to transform a word into it's phonetic code. |
Method Summary |
java.lang.String |
getCode(java.lang.String word)
Returns the phonetic code representing the word. |
java.util.List |
getSuggestions(java.lang.String word,
int threshold)
Returns a list of Word objects that are the suggestions to an
incorrect word. |
protected abstract java.util.List |
getWords(java.lang.String phoneticCode)
Returns a list of words that have the same phonetic code. |
boolean |
isCorrect(java.lang.String word)
Returns true if the word is correctly spelled against the current word list. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tf
protected Transformator tf
- The reference to a Transformator, used to transform a word into it's phonetic code.
SpellDictionaryASpell
public SpellDictionaryASpell(java.io.File phonetic)
throws java.io.IOException
SpellDictionaryASpell
public SpellDictionaryASpell(java.io.File phonetic,
java.lang.String encoding)
throws java.io.IOException
SpellDictionaryASpell
public SpellDictionaryASpell(java.io.Reader phonetic)
throws java.io.IOException
getSuggestions
public java.util.List getSuggestions(java.lang.String word,
int threshold)
- Returns a list of Word objects that are the suggestions to an
incorrect word.
- Specified by:
getSuggestions
in interface SpellDictionary
- Parameters:
word
- Suggestions for given mispelt wordthreshold
- The lower boundary of similarity to mispelt word- Returns:
- Vector a List of suggestions
getCode
public java.lang.String getCode(java.lang.String word)
- Returns the phonetic code representing the word.
getWords
protected abstract java.util.List getWords(java.lang.String phoneticCode)
- Returns a list of words that have the same phonetic code.
isCorrect
public boolean isCorrect(java.lang.String word)
- Returns true if the word is correctly spelled against the current word list.
- Specified by:
isCorrect
in interface SpellDictionary