public final class SetKeywordMarkerFilter extends KeywordMarkerFilter
KeywordAttribute. Each token
contained in the provided set is marked as a keyword by setting
KeywordAttribute.setKeyword(boolean) to true.AttributeSource.State| Modifier and Type | Field and Description |
|---|---|
private CharArraySet |
keywordSet |
private CharTermAttribute |
termAtt |
inputDEFAULT_TOKEN_ATTRIBUTE_FACTORY| Constructor and Description |
|---|
SetKeywordMarkerFilter(TokenStream in,
CharArraySet keywordSet)
Create a new KeywordSetMarkerFilter, that marks the current token as a
keyword if the tokens term buffer is contained in the given set via the
KeywordAttribute. |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
isKeyword() |
incrementTokenclose, end, resetaddAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toStringprivate final CharTermAttribute termAtt
private final CharArraySet keywordSet
public SetKeywordMarkerFilter(TokenStream in, CharArraySet keywordSet)
KeywordAttribute.in - TokenStream to filterkeywordSet - the keywords set to lookup the current termbufferprotected boolean isKeyword()
isKeyword in class KeywordMarkerFilter