public class ProtectedTermFilter extends ConditionalTokenFilter
AttributeSource.State
Modifier and Type | Field and Description |
---|---|
private CharArraySet |
protectedTerms |
private CharTermAttribute |
termAtt |
input
DEFAULT_TOKEN_ATTRIBUTE_FACTORY
Constructor and Description |
---|
ProtectedTermFilter(CharArraySet protectedTerms,
TokenStream input,
java.util.function.Function<TokenStream,TokenStream> inputFactory)
Creates a new ProtectedTermFilter
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
shouldFilter()
Whether or not to execute the wrapped TokenFilter(s) for the current token
|
close, end, incrementToken, reset
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
private final CharArraySet protectedTerms
private final CharTermAttribute termAtt
public ProtectedTermFilter(CharArraySet protectedTerms, TokenStream input, java.util.function.Function<TokenStream,TokenStream> inputFactory)
protectedTerms
- the set of terms to skip the wrapped filters forinput
- the input TokenStreaminputFactory
- a factory function to create the wrapped filter(s)protected boolean shouldFilter()
ConditionalTokenFilter
shouldFilter
in class ConditionalTokenFilter