Package opennlp.tools.stemmer.snowball
Class SnowballStemmerFactory
java.lang.Object
opennlp.tools.stemmer.snowball.SnowballStemmerFactory
- All Implemented Interfaces:
opennlp.tools.stemmer.StemmerFactory
@ThreadSafe
public class SnowballStemmerFactory
extends Object
implements opennlp.tools.stemmer.StemmerFactory
A thread-safe factory that captures a Snowball stemmer configuration for APIs that accept a
StemmerFactory.
Use this factory for the classic one-stemmer-per-thread pattern: newStemmer()
returns a plain, thread-confined stemmer without the per-call thread routing of the
shareable SnowballStemmer.
-
Constructor Summary
ConstructorsConstructorDescriptionSnowballStemmerFactory(SnowballStemmer.ALGORITHM algorithm) Creates a factory withrepeat = 1.SnowballStemmerFactory(SnowballStemmer.ALGORITHM algorithm, int repeat) Creates a factory over the given algorithm and repeat count. -
Method Summary
-
Constructor Details
-
SnowballStemmerFactory
Creates a factory withrepeat = 1.- Parameters:
algorithm- The Snowball algorithm. Must not benull.- Throws:
IllegalArgumentException- ifalgorithmisnull.
-
SnowballStemmerFactory
Creates a factory over the given algorithm and repeat count.- Parameters:
algorithm- The Snowball algorithm. Must not benull.repeat- How many times to apply the stemmer per word; must be positive.- Throws:
IllegalArgumentException- ifalgorithmisnullorrepeatis not positive.
-
-
Method Details
-
newStemmer
public opennlp.tools.stemmer.Stemmer newStemmer()- Specified by:
newStemmerin interfaceopennlp.tools.stemmer.StemmerFactory
-