Class AbstractSpellChecker

java.lang.Object
org.omegat.core.spellchecker.AbstractSpellChecker
All Implemented Interfaces:
ISpellChecker

public abstract class AbstractSpellChecker extends Object implements ISpellChecker
Abstract spell checker with method to handle ISpellCheckerProvider.
  • Constructor Details

    • AbstractSpellChecker

      public AbstractSpellChecker()
  • Method Details

    • initialize

      public boolean initialize()
      Initialize the library for the given project. Loads the lists of ignored and learned words for the project
      Specified by:
      initialize in interface ISpellChecker
    • destroy

      public void destroy()
      destroy the library
      Specified by:
      destroy in interface ISpellChecker
    • saveWordLists

      public void saveWordLists()
      Save the word lists to disk
      Specified by:
      saveWordLists in interface ISpellChecker
    • isCorrect

      public boolean isCorrect(String word)
      Check the word. If it is ignored or learned (valid), returns true. Otherwise, false.
      Specified by:
      isCorrect in interface ISpellChecker
    • suggest

      public List<String> suggest(String word)
      return a list of strings as suggestions
      Specified by:
      suggest in interface ISpellChecker
    • ignoreWord

      public void ignoreWord(String word)
      Add a word to the list of ignored words
      Specified by:
      ignoreWord in interface ISpellChecker
    • learnWord

      public void learnWord(String word)
      Add a word to the list of correct words
      Specified by:
      learnWord in interface ISpellChecker
    • isIgnoredWord

      public boolean isIgnoredWord(String word)
      Description copied from interface: ISpellChecker
      Determine if the given word is on the ignored list.
      Specified by:
      isIgnoredWord in interface ISpellChecker
    • isLearnedWord

      public boolean isLearnedWord(String word)
      Description copied from interface: ISpellChecker
      Determine if the given word is on the learned list.
      Specified by:
      isLearnedWord in interface ISpellChecker
    • getMisspelledTokens

      public List<Token> getMisspelledTokens(String text)
      Description copied from interface: ISpellChecker
      Get a list of misspelled tokens from the given text.
      Specified by:
      getMisspelledTokens in interface ISpellChecker