Class HunspellStemmerFactory

java.lang.Object
opennlp.tools.stemmer.hunspell.HunspellStemmerFactory
All Implemented Interfaces:
opennlp.tools.stemmer.StemmerFactory

@ThreadSafe public class HunspellStemmerFactory extends Object implements opennlp.tools.stemmer.StemmerFactory
The shareable handle for Hunspell stemming: holds one immutable HunspellDictionary and hands out HunspellStemmer instances over it.

The factory is immutable and safe to share across threads.

Since:
3.0.0
  • Constructor Details

    • HunspellStemmerFactory

      public HunspellStemmerFactory(HunspellDictionary dictionary)
      Initializes the factory.
      Parameters:
      dictionary - The dictionary to stem against. Must not be null.
      Throws:
      IllegalArgumentException - Thrown if dictionary is null.
  • Method Details

    • newStemmer

      public opennlp.tools.stemmer.Stemmer newStemmer()

      Every call creates a fresh HunspellStemmer over the same immutable dictionary.

      Specified by:
      newStemmer in interface opennlp.tools.stemmer.StemmerFactory