public class SpellChecker extends java.lang.Object implements ISpellChecker
Modifier and Type | Field and Description |
---|---|
static java.io.File |
DEFAULT_DICTIONARY_DIR |
Constructor and Description |
---|
SpellChecker()
Creates a new instance of SpellChecker
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
destroy the library
|
java.util.List<Token> |
getMisspelledTokens(java.lang.String text)
Get a list of misspelled tokens from the given text
|
void |
ignoreWord(java.lang.String word)
Add a word to the list of ignored words
|
void |
initialize()
Initialize the library for the given project.
|
boolean |
isCorrect(java.lang.String word)
Check the word.
|
boolean |
isIgnoredWord(java.lang.String word)
Determine if the given word is on the ignored list
|
boolean |
isLearnedWord(java.lang.String word)
Determine if the given word is on the learned list
|
void |
learnWord(java.lang.String word)
Add a word to the list of correct words
|
protected void |
resetCache() |
void |
saveWordLists()
Save the word lists to disk
|
java.util.List<java.lang.String> |
suggest(java.lang.String word)
return a list of strings as suggestions
|
public void initialize()
initialize
in interface ISpellChecker
public void destroy()
destroy
in interface ISpellChecker
protected void resetCache()
public void saveWordLists()
saveWordLists
in interface ISpellChecker
public boolean isCorrect(java.lang.String word)
isCorrect
in interface ISpellChecker
public java.util.List<java.lang.String> suggest(java.lang.String word)
suggest
in interface ISpellChecker
public void ignoreWord(java.lang.String word)
ignoreWord
in interface ISpellChecker
public void learnWord(java.lang.String word)
learnWord
in interface ISpellChecker
public boolean isIgnoredWord(java.lang.String word)
ISpellChecker
isIgnoredWord
in interface ISpellChecker
public boolean isLearnedWord(java.lang.String word)
ISpellChecker
isLearnedWord
in interface ISpellChecker
public java.util.List<Token> getMisspelledTokens(java.lang.String text)
ISpellChecker
getMisspelledTokens
in interface ISpellChecker