Interface WebappSpellchecker


@API(type=NOT_EXTENDABLE, src=PUBLIC) public interface WebappSpellchecker
  • Method Details

    • getSuggestionsForWordAtPosition

      SpellSuggestionsInfo getSuggestionsForWordAtPosition(int position) throws BadLocationException, IOException
      Gets the suggestions for the word at a certain position.
      Parameters:
      position - Position in the document.
      Returns:
      List of spellchecking suggestions for the word.
      Throws:
      BadLocationException
      IOException
    • replaceWithSuggestion

      void replaceWithSuggestion(int startOffset, int endOffset, String newWord) throws BadLocationException, IOException
      Replaces word at a certain position.
      Parameters:
      startOffset - Start offset for replacement.
      endOffset - End offset for replacement.
      newWord - Word to be inserted.
      Throws:
      BadLocationException
      IOException
    • getTextDescriptors

      List<TextChunkDescriptor> getTextDescriptors(int startOffset, int endOffset)
      Returns the list of descriptors for chunks of text between the given offsets.
      Parameters:
      startOffset - The start offset.
      endOffset - The end offset.
      Returns:
      The list of text descriptors.
    • check

      Performs a spellcheck of the given text descriptors. This method is thread-safe. Can be called on multiple threads and can also be called while other threads are modifying the document.
      Parameters:
      textDescriptors - The text descriptors.
      Returns:
      The list of spelling problems.
      Throws:
      IOException - If there is a problem reading the dictionaries.
    • getTermsDictionary

      Dictionary getTermsDictionary()
      Get the current custom terms dictionary to be applied when doing spell checking actions.
      Returns:
      Returns the custom terms dictionary.
      Since:
      21
    • setTermsDictionary

      void setTermsDictionary(Dictionary apiDict)
      Set a custom terms dictionary to be used on spell checking actions.
      Parameters:
      apiDict - The terms dictionary to set.
      Since:
      21
    • setDefaultLanguage

      void setDefaultLanguage(String lang)
      Sets the default language to be used for spell checking if an xml:lang attribute is not specified. Examples of format: en_US, fr_FR, de_DE, jp_JP, it_IT, nl_NL
      Parameters:
      lang - The language used to be used for spell checking.
      Since:
      21
    • setSpellcheckingEngine

      void setSpellcheckingEngine(String lang, SpellcheckingEngine checker)
      Sets the default spellchecker for a language. Examples of language format: en_US, fr_FR, de_DE, jp_JP, it_IT, nl_NL
      Parameters:
      lang - The language to be handled by the spell checking engine.
      checker - The spell checking engine to be used for the language.
      Since:
      21