Class SpellingCorrector

  • public class SpellingCorrector
    extends DictionaryBase

    Represents a spelling corrector for terms in query.

    • Method Detail

      • getCount

        public final int getCount()

        Gets the number of words contained in the SpellingCorrector.

      • getWords

        public final String[] getWords()

        Gets the word collection that is contained in a corrector.

        The word collection.
      • addRange

        public final void addRange(Iterable<String> words)

        Adds the specified collection of words to this instance of the SpellingCorrector.

        words - The collection of words to add to the dictionary.
        Throws: - Thrown when words is null.
      • clear

        public final void clear()

        Removes all words from a SpellingCorrector object.

      • exportDictionary

        public final void exportDictionary(String fileName)

        Exports the internal dictionary to the specified text file.

        fileName - The file to export to.
      • importDictionary

        public final void importDictionary(String fileName)

        Imports a dictionary from the specified text file.

        fileName - The file to import from.