Package org.omegat.core.spellchecker
Class SpellChecker
- java.lang.Object
-
- org.omegat.core.spellchecker.SpellChecker
-
- All Implemented Interfaces:
ISpellChecker
public class SpellChecker extends java.lang.Object implements ISpellChecker
Common spell checker interface for use any spellchecker providers.
-
-
Field Summary
Fields Modifier and Type Field Description static java.io.FileDEFAULT_DICTIONARY_DIR
-
Constructor Summary
Constructors Constructor Description SpellChecker()Creates a new instance of SpellChecker
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()destroy the libraryjava.util.List<Token>getMisspelledTokens(java.lang.String text)Get a list of misspelled tokens from the given textvoidignoreWord(java.lang.String word)Add a word to the list of ignored wordsvoidinitialize()Initialize the library for the given project.booleanisCorrect(java.lang.String word)Check the word.booleanisIgnoredWord(java.lang.String word)Determine if the given word is on the ignored listbooleanisLearnedWord(java.lang.String word)Determine if the given word is on the learned listvoidlearnWord(java.lang.String word)Add a word to the list of correct wordsvoidsaveWordLists()Save the word lists to diskjava.util.List<java.lang.String>suggest(java.lang.String word)return a list of strings as suggestions
-
-
-
Method Detail
-
initialize
public void initialize()
Initialize the library for the given project. Loads the lists of ignored and learned words for the project- Specified by:
initializein interfaceISpellChecker
-
destroy
public void destroy()
destroy the library- Specified by:
destroyin interfaceISpellChecker
-
saveWordLists
public void saveWordLists()
Save the word lists to disk- Specified by:
saveWordListsin interfaceISpellChecker
-
isCorrect
public boolean isCorrect(java.lang.String word)
Check the word. If it is ignored or learned (valid), returns true. Otherwise false.- Specified by:
isCorrectin interfaceISpellChecker
-
suggest
public java.util.List<java.lang.String> suggest(java.lang.String word)
return a list of strings as suggestions- Specified by:
suggestin interfaceISpellChecker
-
ignoreWord
public void ignoreWord(java.lang.String word)
Add a word to the list of ignored words- Specified by:
ignoreWordin interfaceISpellChecker
-
learnWord
public void learnWord(java.lang.String word)
Add a word to the list of correct words- Specified by:
learnWordin interfaceISpellChecker
-
isIgnoredWord
public boolean isIgnoredWord(java.lang.String word)
Description copied from interface:ISpellCheckerDetermine if the given word is on the ignored list- Specified by:
isIgnoredWordin interfaceISpellChecker
-
isLearnedWord
public boolean isLearnedWord(java.lang.String word)
Description copied from interface:ISpellCheckerDetermine if the given word is on the learned list- Specified by:
isLearnedWordin interfaceISpellChecker
-
getMisspelledTokens
public java.util.List<Token> getMisspelledTokens(java.lang.String text)
Description copied from interface:ISpellCheckerGet a list of misspelled tokens from the given text- Specified by:
getMisspelledTokensin interfaceISpellChecker
-
-