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 Details

    • StempelStemmer

      public StempelStemmer(InputStream stemmerTable) throws IOException
      Create a Stemmer using selected stemmer table
      Parameters:
      stemmerTable - stemmer table.
      Throws:
      IOException
    • StempelStemmer

      public StempelStemmer(Trie stemmer)
      Create a Stemmer using pre-loaded stemmer table
      Parameters:
      stemmer - pre-loaded stemmer table
  • Method Details

    • load

      public static 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.