org.apache.lucene.analysis.miscellaneous
Class PrefixAwareTokenFilter
java.lang.Object
org.apache.lucene.analysis.TokenStream
org.apache.lucene.analysis.miscellaneous.PrefixAwareTokenFilter
public class PrefixAwareTokenFilter
- extends TokenStream
Joins two token streams and leaves the last token of the first stream available
to be used when updating the token values in the second stream based on that token.
The default implementation adds last prefix token end offset to the suffix token start and end offsets.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PrefixAwareTokenFilter
public PrefixAwareTokenFilter(TokenStream prefix,
TokenStream suffix)
next
public Token next(Token reusableToken)
throws IOException
- Overrides:
next
in class TokenStream
- Throws:
IOException
updateSuffixToken
public Token updateSuffixToken(Token suffixToken,
Token lastPrefixToken)
- The default implementation adds last prefix token end offset to the suffix token start and end offsets.
- Parameters:
suffixToken
- a token from the suffix streamlastPrefixToken
- the last token from the prefix stream
- Returns:
- consumer token
close
public void close()
throws IOException
- Overrides:
close
in class TokenStream
- Throws:
IOException
reset
public void reset()
throws IOException
- Overrides:
reset
in class TokenStream
- Throws:
IOException
getPrefix
public TokenStream getPrefix()
setPrefix
public void setPrefix(TokenStream prefix)
getSuffix
public TokenStream getSuffix()
setSuffix
public void setSuffix(TokenStream suffix)
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.