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