|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.swabunga.spell.event.SpellChecker
This is the main class for spell checking (using the new event based spell checking).
Field Summary | |
static int |
SPELLCHECK_CANCEL
Flag indicating that the Spell Check completed due to user cancellation |
static int |
SPELLCHECK_OK
Flag indicating that the Spell Check completed without any errors present |
Constructor Summary | |
SpellChecker()
Constructs the SpellChecker. |
|
SpellChecker(SpellDictionary dictionary)
Constructs the SpellChecker. |
|
SpellChecker(SpellDictionary dictionary,
int threshold)
Constructs the SpellChecker with a threshold |
Method Summary | |
void |
addDictionary(SpellDictionary dictionary)
|
void |
addSpellCheckListener(SpellCheckListener listener)
Adds a SpellCheckListener |
int |
checkSpelling(WordTokenizer tokenizer)
This method is called to check the spelling of the words that are returned by the WordTokenizer. |
java.lang.String |
checkString(java.lang.String text)
Deprecated. use checkSpelling(WordTokenizer) |
protected boolean |
fireAndHandleEvent(WordTokenizer tokenizer,
SpellCheckEvent event)
This method will fire the spell check event and then handle the event action that has been selected by the user. |
protected void |
fireSpellCheckEvent(SpellCheckEvent event)
Fires off a spell check event to the listeners. |
Configuration |
getConfiguration()
|
java.util.List |
getSuggestions(java.lang.String word,
int threshold)
|
static boolean |
isINETWord(java.lang.String word)
Returns true iff this word looks like an internet address. |
void |
removeSpellCheckListener(SpellCheckListener listener)
Removes a SpellCheckListener |
void |
reset()
This method clears the words that are currently being remembered as Ignore All words and Replace All words. |
void |
setUserDictionary(SpellDictionary dictionary)
Set user dictionary (used when a word is added) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SPELLCHECK_OK
public static final int SPELLCHECK_CANCEL
Constructor Detail |
public SpellChecker()
public SpellChecker(SpellDictionary dictionary)
dictionary
- Description of the Parameterpublic SpellChecker(SpellDictionary dictionary, int threshold)
dictionary
- Description of the Parameterthreshold
- Description of the ParameterMethod Detail |
public void addDictionary(SpellDictionary dictionary)
public void setUserDictionary(SpellDictionary dictionary)
public Configuration getConfiguration()
public void addSpellCheckListener(SpellCheckListener listener)
listener
- The feature to be added to the SpellCheckListener attributepublic void removeSpellCheckListener(SpellCheckListener listener)
listener
- Description of the Parameterprotected void fireSpellCheckEvent(SpellCheckEvent event)
event
- Description of the Parameterpublic void reset()
public java.lang.String checkString(java.lang.String text)
Returns the corrected string.
text
- Description of the Parameter
public static final boolean isINETWord(java.lang.String word)
word
- Description of the Parameter
protected boolean fireAndHandleEvent(WordTokenizer tokenizer, SpellCheckEvent event)
tokenizer
- Description of the Parameterevent
- Description of the Parameter
public java.util.List getSuggestions(java.lang.String word, int threshold)
public final int checkSpelling(WordTokenizer tokenizer)
For each invalid word the action listeners will be informed with a new SpellCheckEvent
tokenizer
- Description of the Parameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |