public final class KStemFilter extends TokenFilter
See "Viewing Morphology as an Inference Process" (Krovetz, R., Proceedings of the Sixteenth Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, 191-203, 1993).
All terms must already be lowercased for this filter to work correctly.
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
Modifier and Type | Field and Description |
---|---|
private KeywordAttribute |
keywordAtt |
private KStemmer |
stemmer |
private CharTermAttribute |
termAttribute |
input
DEFAULT_TOKEN_ATTRIBUTE_FACTORY
Constructor and Description |
---|
KStemFilter(TokenStream in) |
Modifier and Type | Method and Description |
---|---|
boolean |
incrementToken()
Returns the next, stemmed, input Token.
|
close, end, reset
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
private final KStemmer stemmer
private final CharTermAttribute termAttribute
private final KeywordAttribute keywordAtt
public KStemFilter(TokenStream in)
public boolean incrementToken() throws java.io.IOException
incrementToken
in class TokenStream
java.io.IOException
- If there is a low-level I/O error.