public class PrefixAwareTokenFilter extends TokenStream
NOTE: This filter might not behave correctly if used with custom Attributes, i.e. Attributes other than the ones located in org.apache.lucene.analysis.tokenattributes.
AttributeSource.StateDEFAULT_TOKEN_ATTRIBUTE_FACTORY| Constructor and Description |
|---|
PrefixAwareTokenFilter(TokenStream prefix,
TokenStream suffix) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
end() |
TokenStream |
getPrefix() |
TokenStream |
getSuffix() |
boolean |
incrementToken() |
void |
reset() |
void |
setPrefix(TokenStream prefix) |
void |
setSuffix(TokenStream suffix) |
Token |
updateSuffixToken(Token suffixToken,
Token lastPrefixToken)
The default implementation adds last prefix token end offset to the suffix token start and end offsets.
|
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toStringpublic PrefixAwareTokenFilter(TokenStream prefix, TokenStream suffix)
public final boolean incrementToken()
throws IOException
incrementToken in class TokenStreamIOExceptionpublic Token updateSuffixToken(Token suffixToken, Token lastPrefixToken)
suffixToken - a token from the suffix streamlastPrefixToken - the last token from the prefix streampublic void end()
throws IOException
end in class TokenStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class TokenStreamIOExceptionpublic void reset()
throws IOException
reset in class TokenStreamIOExceptionpublic TokenStream getPrefix()
public void setPrefix(TokenStream prefix)
public TokenStream getSuffix()
public void setSuffix(TokenStream suffix)
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.