public final class PatternKeywordMarkerFilter extends KeywordMarkerFilter
KeywordAttribute
. Each token
that matches the provided pattern is marked as a keyword by setting
KeywordAttribute.setKeyword(boolean)
to true
.AttributeSource.State
input
DEFAULT_TOKEN_ATTRIBUTE_FACTORY
Constructor and Description |
---|
PatternKeywordMarkerFilter(TokenStream in,
Pattern pattern)
Create a new
PatternKeywordMarkerFilter , that marks the current
token as a keyword if the tokens term buffer matches the provided
Pattern 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 PatternKeywordMarkerFilter(TokenStream in, Pattern pattern)
PatternKeywordMarkerFilter
, that marks the current
token as a keyword if the tokens term buffer matches the provided
Pattern
via the KeywordAttribute
.in
- TokenStream to filterpattern
- the pattern to apply to the incoming term bufferprotected boolean isKeyword()
isKeyword
in class KeywordMarkerFilter
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.