public final class LengthFilter extends FilteringTokenFilter
Note: Length is calculated as the number of UTF-16 code units.
AttributeSource.State
version
input
DEFAULT_TOKEN_ATTRIBUTE_FACTORY
DEFAULT_ATTRIBUTE_FACTORY
Constructor and Description |
---|
LengthFilter(TokenStream in,
int min,
int max)
Create a new
LengthFilter . |
LengthFilter(Version version,
boolean enablePositionIncrements,
TokenStream in,
int min,
int max)
Deprecated.
enablePositionIncrements=false is not supported anymore as of Lucene 4.4.
|
LengthFilter(Version version,
TokenStream in,
int min,
int max)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept()
Override this method and return if the current input token should be returned by
FilteringTokenFilter.incrementToken() . |
end, getEnablePositionIncrements, incrementToken, reset, setEnablePositionIncrements
close
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState, toString
@Deprecated public LengthFilter(Version version, boolean enablePositionIncrements, TokenStream in, int min, int max)
public LengthFilter(TokenStream in, int min, int max)
LengthFilter
. This will filter out tokens whose
CharTermAttribute
is either too short (CharSequence.length()
< min) or too long (CharSequence.length()
> max).in
- the TokenStream
to consumemin
- the minimum lengthmax
- the maximum length@Deprecated public LengthFilter(Version version, TokenStream in, int min, int max)
LengthFilter(TokenStream, int, int)
public boolean accept()
FilteringTokenFilter
FilteringTokenFilter.incrementToken()
.accept
in class FilteringTokenFilter
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.