Class StempelStemmer
- java.lang.Object
-
- org.apache.lucene.analysis.stempel.StempelStemmer
-
public class StempelStemmer extends Object
Stemmer class is a convenient facade for other stemmer-related classes. The core stemming algorithm and its implementation is taken verbatim from the Egothor project ( www.egothor.org ).Even though the stemmer tables supplied in the distribution package are built for Polish language, there is nothing language-specific here.
-
-
Constructor Summary
Constructors Constructor Description StempelStemmer(InputStream stemmerTable)
Create a Stemmer using selected stemmer tableStempelStemmer(org.egothor.stemmer.Trie stemmer)
Create a Stemmer using pre-loaded stemmer table
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.egothor.stemmer.Trie
load(InputStream stemmerTable)
Load a stemmer table from an inputstream.StringBuilder
stem(CharSequence word)
Stem a word.
-
-
-
Constructor Detail
-
StempelStemmer
public StempelStemmer(InputStream stemmerTable) throws IOException
Create a Stemmer using selected stemmer table- Parameters:
stemmerTable
- stemmer table.- Throws:
IOException
-
StempelStemmer
public StempelStemmer(org.egothor.stemmer.Trie stemmer)
Create a Stemmer using pre-loaded stemmer table- Parameters:
stemmer
- pre-loaded stemmer table
-
-
Method Detail
-
load
public static org.egothor.stemmer.Trie load(InputStream stemmerTable) throws IOException
Load a stemmer table from an inputstream.- Throws:
IOException
-
stem
public StringBuilder stem(CharSequence word)
Stem a word.- Parameters:
word
- input word to be stemmed.- Returns:
- stemmed word, or null if the stem could not be generated.
-
-