public final class CommonGramsFilter extends TokenFilter
PositionIncrementAttribute.setPositionIncrement(int)
. Bigrams have a type
of GRAM_TYPE
Example:
AttributeSource.State
Modifier and Type | Field and Description |
---|---|
static String |
GRAM_TYPE |
input
DEFAULT_TOKEN_ATTRIBUTE_FACTORY
DEFAULT_ATTRIBUTE_FACTORY
Constructor and Description |
---|
CommonGramsFilter(TokenStream input,
CharArraySet commonWords)
Construct a token stream filtering the given input using a Set of common
words to create bigrams.
|
CommonGramsFilter(Version matchVersion,
TokenStream input,
CharArraySet commonWords)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
incrementToken()
Inserts bigrams for common words into a token stream.
|
void |
reset() |
close, end
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState, toString
public static final String GRAM_TYPE
public CommonGramsFilter(TokenStream input, CharArraySet commonWords)
input
- TokenStream input in filter chaincommonWords
- The set of common words.@Deprecated public CommonGramsFilter(Version matchVersion, TokenStream input, CharArraySet commonWords)
CommonGramsFilter(TokenStream, CharArraySet)
public boolean incrementToken() throws IOException
incrementToken
in class TokenStream
IOException
public void reset() throws IOException
reset
in class TokenFilter
IOException
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.