public final class TypeTokenFilter extends FilteringTokenFilter
AttributeSource.State| Modifier and Type | Field and Description |
|---|---|
private java.util.Set<java.lang.String> |
stopTypes |
private TypeAttribute |
typeAttribute |
private boolean |
useWhiteList |
inputDEFAULT_TOKEN_ATTRIBUTE_FACTORY| Constructor and Description |
|---|
TypeTokenFilter(TokenStream input,
java.util.Set<java.lang.String> stopTypes)
Create a new
TypeTokenFilter that filters tokens out
(useWhiteList=false). |
TypeTokenFilter(TokenStream input,
java.util.Set<java.lang.String> stopTypes,
boolean useWhiteList)
Create a new
TypeTokenFilter. |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
accept()
By default accept the token if its type is not a stop type.
|
end, incrementToken, resetcloseaddAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toStringprivate final java.util.Set<java.lang.String> stopTypes
private final TypeAttribute typeAttribute
private final boolean useWhiteList
public TypeTokenFilter(TokenStream input, java.util.Set<java.lang.String> stopTypes, boolean useWhiteList)
TypeTokenFilter.input - the TokenStream to consumestopTypes - the types to filteruseWhiteList - if true, then tokens whose type is in stopTypes will
be kept, otherwise they will be filtered outpublic TypeTokenFilter(TokenStream input, java.util.Set<java.lang.String> stopTypes)
TypeTokenFilter that filters tokens out
(useWhiteList=false).protected boolean accept()
accept in class FilteringTokenFilter