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.
|
| 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, restoreStatepublic LengthFilter(boolean enablePositionIncrements,
TokenStream in,
int min,
int max)
public boolean accept()
FilteringTokenFilterFilteringTokenFilter.incrementToken().accept in class FilteringTokenFilterCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.