Closeable
, AutoCloseable
public final class LengthFilter extends FilteringTokenFilter
Note: Length is calculated as the number of UTF-16 code units.
AttributeSource.AttributeFactory, AttributeSource.State
input
Constructor | 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 | Description |
---|---|---|
boolean |
accept() |
Override this method and return if the current input token should be returned by
FilteringTokenFilter.incrementToken() . |
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState, toString
getEnablePositionIncrements, incrementToken, reset, setEnablePositionIncrements
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
close, end
public 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
FilteringTokenFilter
FilteringTokenFilter.incrementToken()
.accept
in class FilteringTokenFilter
IOException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.