| java.lang.Object org.apache.lucene.analysis.TokenStream org.apache.lucene.analysis.TokenFilter org.apache.lucene.index.memory.SynonymTokenFilter
SynonymTokenFilter | public class SynonymTokenFilter extends TokenFilter (Code) | | Injects additional tokens for synonyms of token terms fetched from the
underlying child stream; the child stream must deliver lowercase tokens
for synonyms to be found.
author: whoschek.AT.lbl.DOT.gov |
Field Summary | |
final public static String | SYNONYM_TOKEN_TYPE The Token.type used to indicate a synonym to higher level filters. |
Method Summary | |
protected Token | createToken(String synonym, Token current) Creates and returns a token for the given synonym of the current input
token; Override for custom (stateless or stateful) behaviour, if desired. | public Token | next() Returns the next token in the stream, or null at EOS. |
SYNONYM_TOKEN_TYPE | final public static String SYNONYM_TOKEN_TYPE(Code) | | The Token.type used to indicate a synonym to higher level filters.
|
SynonymTokenFilter | public SynonymTokenFilter(TokenStream input, SynonymMap synonyms, int maxSynonyms)(Code) | | Creates an instance for the given underlying stream and synonym table.
Parameters: input - the underlying child token stream Parameters: synonyms - the map used to extract synonyms for terms Parameters: maxSynonyms - the maximum number of synonym tokens to return per underlyingtoken word (a value of Integer.MAX_VALUE indicates unlimited) |
createToken | protected Token createToken(String synonym, Token current)(Code) | | Creates and returns a token for the given synonym of the current input
token; Override for custom (stateless or stateful) behaviour, if desired.
Parameters: synonym - a synonym for the current token's term Parameters: current - the current token from the underlying child stream a new token, or null to indicate that the given synonym should beignored |
|
|