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
input
DEFAULT_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() |
incrementToken
close, end, reset
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
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
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.