public final class LengthFilter extends FilteringTokenFilter
Note: Length is calculated as the number of UTF-16 code units.
AttributeSource.AttributeFactory, AttributeSource.State
input
Constructor and Description |
---|
LengthFilter(boolean enablePositionIncrements,
TokenStream in,
int min,
int max)
Build a filter that removes words that are too long or too
short from the text.
|
LengthFilter(TokenStream in,
int min,
int max)
Deprecated.
Use
LengthFilter(boolean, TokenStream, int, int) instead. |
Modifier and Type | Method and Description |
---|---|
boolean |
accept()
Override this method and return if the current input token should be returned by
FilteringTokenFilter.incrementToken() . |
getEnablePositionIncrements, incrementToken, reset, setEnablePositionIncrements
close, end
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState, toString
public LengthFilter(boolean enablePositionIncrements, TokenStream in, int min, int max)
@Deprecated public LengthFilter(TokenStream in, int min, int max)
LengthFilter(boolean, TokenStream, int, int)
instead.public boolean accept() throws IOException
FilteringTokenFilter
FilteringTokenFilter.incrementToken()
.accept
in class FilteringTokenFilter
IOException