Package opennlp.tools.stemmer.hunspell
Class HunspellStemmerFactory
java.lang.Object
opennlp.tools.stemmer.hunspell.HunspellStemmerFactory
- All Implemented Interfaces:
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
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHunspellStemmerFactory(HunspellDictionary dictionary) Initializes the factory. -
Method Summary
-
Field Details
-
dictionary
-
-
Constructor Details
-
HunspellStemmerFactory
Initializes the factory.- Parameters:
dictionary- The dictionary to stem against. Must not benull.- Throws:
IllegalArgumentException- Thrown ifdictionaryisnull.
-
-
Method Details
-
newStemmer
Returns a newStemmer.Every call creates a fresh
HunspellStemmerover the same immutable dictionary.- Specified by:
newStemmerin interfaceStemmerFactory- Returns:
- a new
Stemmer
-