Class StempelFilter

All Implemented Interfaces:
Closeable, AutoCloseable, Unwrappable<TokenStream>

public final class StempelFilter extends TokenFilter
Transforms the token stream as per the stemming algorithm.

Note: the input to the stemming filter must already be in lower case, so you will need to use LowerCaseFilter or LowerCaseTokenizer farther down the Tokenizer chain in order for this to work properly!

  • Field Details

    • termAtt

      private final CharTermAttribute termAtt
    • keywordAtt

      private final KeywordAttribute keywordAtt
    • stemmer

      private final StempelStemmer stemmer
    • minLength

      private final int minLength
    • DEFAULT_MIN_LENGTH

      public static final int DEFAULT_MIN_LENGTH
      Minimum length of input words to be processed. Shorter words are returned unchanged.
      See Also:
  • Constructor Details

    • StempelFilter

      public StempelFilter(TokenStream in, StempelStemmer stemmer)
      Create filter using the supplied stemming table.
      Parameters:
      in - input token stream
      stemmer - stemmer
    • StempelFilter

      public StempelFilter(TokenStream in, StempelStemmer stemmer, int minLength)
      Create filter using the supplied stemming table.
      Parameters:
      in - input token stream
      stemmer - stemmer
      minLength - For performance reasons words shorter than minLength characters are not processed, but simply returned.
  • Method Details

    • incrementToken

      public boolean incrementToken() throws IOException
      Returns the next input Token, after being stemmed
      Specified by:
      incrementToken in class TokenStream
      Returns:
      false for end of stream; true otherwise
      Throws:
      IOException