public final class HunspellStemFilter extends TokenFilter
Note: This filter is aware of the KeywordAttribute
. To prevent
certain terms from being passed to the stemmer
KeywordAttribute.isKeyword()
should be set to true
in a previous TokenStream
.
Note: For including the original term as well as the stemmed version, see
KeywordRepeatFilterFactory
AttributeSource.State
input
DEFAULT_TOKEN_ATTRIBUTE_FACTORY
Constructor and Description |
---|
HunspellStemFilter(TokenStream input,
Dictionary dictionary)
Create a
HunspellStemFilter outputting all possible stems. |
HunspellStemFilter(TokenStream input,
Dictionary dictionary,
boolean dedup)
Create a
HunspellStemFilter outputting all possible stems. |
HunspellStemFilter(TokenStream input,
Dictionary dictionary,
boolean dedup,
boolean longestOnly)
Creates a new HunspellStemFilter that will stem tokens from the given TokenStream using affix rules in the provided
Dictionary
|
Modifier and Type | Method and Description |
---|---|
boolean |
incrementToken() |
void |
reset() |
close, end
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
public HunspellStemFilter(TokenStream input, Dictionary dictionary)
HunspellStemFilter
outputting all possible stems.public HunspellStemFilter(TokenStream input, Dictionary dictionary, boolean dedup)
HunspellStemFilter
outputting all possible stems.public HunspellStemFilter(TokenStream input, Dictionary dictionary, boolean dedup, boolean longestOnly)
input
- TokenStream whose tokens will be stemmeddictionary
- HunspellDictionary containing the affix rules and words that will be used to stem the tokenslongestOnly
- true if only the longest term should be output.public boolean incrementToken() throws IOException
incrementToken
in class TokenStream
IOException
public void reset() throws IOException
reset
in class TokenFilter
IOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.