public final class CodepointCountFilter extends FilteringTokenFilter
Note: Length is calculated as the number of Unicode codepoints.
AttributeSource.State
input
DEFAULT_TOKEN_ATTRIBUTE_FACTORY
Constructor and Description |
---|
CodepointCountFilter(TokenStream in,
int min,
int max)
Create a new
CodepointCountFilter . |
Modifier and Type | Method and Description |
---|---|
boolean |
accept() |
end, incrementToken, reset
close
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
public CodepointCountFilter(TokenStream in, int min, int max)
CodepointCountFilter
. This will filter out tokens whose
CharTermAttribute
is either too short (Character.codePointCount(char[], int, int)
< min) or too long (Character.codePointCount(char[], int, int)
> max).in
- the TokenStream
to consumemin
- the minimum lengthmax
- the maximum lengthpublic boolean accept()
accept
in class FilteringTokenFilter
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.