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 |
inputDEFAULT_TOKEN_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.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
incrementToken()
Inserts bigrams for common words into a token stream.
|
void |
reset() |
close, endaddAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toStringpublic static final String GRAM_TYPE
public CommonGramsFilter(TokenStream input, CharArraySet commonWords)
input - TokenStream input in filter chaincommonWords - The set of common words.public boolean incrementToken()
throws IOException
incrementToken in class TokenStreamIOExceptionpublic void reset()
throws IOException
reset in class TokenFilterIOExceptionCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.