com.swabunga.spell.engine
Class SpellDictionaryASpell

java.lang.Object
  extended by 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.


Constructor Summary
SpellDictionaryASpell(java.io.File phonetic)
           
SpellDictionaryASpell(java.io.File phonetic, java.lang.String encoding)
           
SpellDictionaryASpell(java.io.Reader phonetic)
           
 
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.
 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.swabunga.spell.engine.SpellDictionary
addWord
 

Constructor Detail

SpellDictionaryASpell

public SpellDictionaryASpell(java.io.File phonetic)
                      throws java.io.IOException
Throws:
java.io.IOException

SpellDictionaryASpell

public SpellDictionaryASpell(java.io.File phonetic,
                             java.lang.String encoding)
                      throws java.io.IOException
Throws:
java.io.IOException

SpellDictionaryASpell

public SpellDictionaryASpell(java.io.Reader phonetic)
                      throws java.io.IOException
Throws:
java.io.IOException
Method Detail

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 word
threshold - The lower boundary of similarity to mispelt word
Returns:
Vector a List of suggestions
See Also:
Word

getCode

public java.lang.String getCode(java.lang.String word)
Returns the phonetic code representing the word.


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