Package org.apache.lucene.analysis.core
Class TypeTokenFilter
- java.lang.Object
- 
- org.apache.lucene.util.AttributeSource
- 
- org.apache.lucene.analysis.TokenStream
- 
- org.apache.lucene.analysis.TokenFilter
- 
- org.apache.lucene.analysis.FilteringTokenFilter
- 
- org.apache.lucene.analysis.core.TypeTokenFilter
 
 
 
 
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- Unwrappable<TokenStream>
 
 public final class TypeTokenFilter extends FilteringTokenFilter Removes tokens whose types appear in a set of blocked types from a token stream.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class org.apache.lucene.util.AttributeSourceAttributeSource.State
 
- 
 - 
Field Summary- 
Fields inherited from class org.apache.lucene.analysis.TokenFilterinput
 - 
Fields inherited from class org.apache.lucene.analysis.TokenStreamDEFAULT_TOKEN_ATTRIBUTE_FACTORY
 
- 
 - 
Constructor SummaryConstructors Constructor Description TypeTokenFilter(TokenStream input, Set<String> stopTypes)Create a newTypeTokenFilterthat filters tokens out (useWhiteList=false).TypeTokenFilter(TokenStream input, Set<String> stopTypes, boolean useWhiteList)Create a newTypeTokenFilter.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanaccept()By default accept the token if its type is not a stop type.- 
Methods inherited from class org.apache.lucene.analysis.FilteringTokenFilterend, incrementToken, reset
 - 
Methods inherited from class org.apache.lucene.analysis.TokenFilterclose, unwrap
 - 
Methods inherited from class org.apache.lucene.util.AttributeSourceaddAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
 
- 
 
- 
- 
- 
Constructor Detail- 
TypeTokenFilterpublic TypeTokenFilter(TokenStream input, Set<String> stopTypes, boolean useWhiteList) Create a newTypeTokenFilter.- Parameters:
- input- the- TokenStreamto consume
- stopTypes- the types to filter
- useWhiteList- if true, then tokens whose type is in stopTypes will be kept, otherwise they will be filtered out
 
 - 
TypeTokenFilterpublic TypeTokenFilter(TokenStream input, Set<String> stopTypes) Create a newTypeTokenFilterthat filters tokens out (useWhiteList=false).
 
- 
 - 
Method Detail- 
acceptprotected boolean accept() By default accept the token if its type is not a stop type. When the useWhiteList parameter is set to true then accept the token if its type is contained in the stopTypes- Specified by:
- acceptin class- FilteringTokenFilter
 
 
- 
 
-