public final class MockTokenFilter extends TokenFilter
.{12,}
to act like a lengthfilter
AttributeSource.AttributeFactory, AttributeSource.State
Modifier and Type | Field and Description |
---|---|
static CharacterRunAutomaton |
EMPTY_STOPSET
Empty set of stopwords
|
static CharacterRunAutomaton |
ENGLISH_STOPSET
Set of common english stopwords
|
input
Constructor and Description |
---|
MockTokenFilter(TokenStream input,
CharacterRunAutomaton filter)
Create a new MockTokenFilter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getEnablePositionIncrements() |
boolean |
incrementToken() |
void |
setEnablePositionIncrements(boolean enable)
If
true , this Filter will preserve
positions of the incoming tokens (ie, accumulate and
set position increments of the removed stop tokens). |
close, end, reset
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState
public static final CharacterRunAutomaton EMPTY_STOPSET
public static final CharacterRunAutomaton ENGLISH_STOPSET
public MockTokenFilter(TokenStream input, CharacterRunAutomaton filter)
input
- TokenStream to filterfilter
- DFA representing the terms that should be removed.public boolean incrementToken() throws IOException
incrementToken
in class TokenStream
IOException
public boolean getEnablePositionIncrements()
setEnablePositionIncrements(boolean)
public void setEnablePositionIncrements(boolean enable)
true
, this Filter will preserve
positions of the incoming tokens (ie, accumulate and
set position increments of the removed stop tokens).Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.