public final class LengthFilter extends FilteringTokenFilter
Note: Length is calculated as the number of UTF-16 code units.
AttributeSource.AttributeFactory, AttributeSource.Stateinput| 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, setEnablePositionIncrementsclose, endaddAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState, toStringpublic 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
FilteringTokenFilterFilteringTokenFilter.incrementToken().accept in class FilteringTokenFilterIOExceptionCopyright © 2000-2012 Apache Software Foundation. All Rights Reserved.