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 Summary
ConstructorsConstructorDescriptionHunspellStemmerFactory(HunspellDictionary dictionary) Initializes the factory. -
Method Summary
-
Constructor Details
-
HunspellStemmerFactory
Initializes the factory.- Parameters:
dictionary- The dictionary to stem against. Must not benull.- Throws:
IllegalArgumentException- Thrown ifdictionaryisnull.
-
-
Method Details
-
newStemmer
public opennlp.tools.stemmer.Stemmer newStemmer()Every call creates a fresh
HunspellStemmerover the same immutable dictionary.- Specified by:
newStemmerin interfaceopennlp.tools.stemmer.StemmerFactory
-