public final class TypeTokenFilter extends FilteringTokenFilter
AttributeSource.State
input
DEFAULT_TOKEN_ATTRIBUTE_FACTORY
Constructor and Description |
---|
TypeTokenFilter(TokenStream input,
Set<String> stopTypes)
Create a new
TypeTokenFilter that filters tokens out
(useWhiteList=false). |
TypeTokenFilter(TokenStream input,
Set<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, reset
close
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
public TypeTokenFilter(TokenStream input, Set<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, Set<String> stopTypes)
TypeTokenFilter
that filters tokens out
(useWhiteList=false).protected boolean accept()
accept
in class FilteringTokenFilter
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.