Save This Page
Home » lucene-2.3.2-src » org.apache » lucene » index » memory » [javadoc | source]
org.apache.lucene.index.memory
public class: SynonymTokenFilter [javadoc | source]
java.lang.Object
   org.apache.lucene.analysis.TokenStream
      org.apache.lucene.analysis.TokenFilter
         org.apache.lucene.index.memory.SynonymTokenFilter
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.
Field Summary
public static final  String SYNONYM_TOKEN_TYPE    The Token.type used to indicate a synonym to higher level filters. 
Fields inherited from org.apache.lucene.analysis.TokenFilter:
input
Constructor:
 public SynonymTokenFilter(TokenStream input,
    SynonymMap synonyms,
    int maxSynonyms) 
    Creates an instance for the given underlying stream and synonym table.
    Parameters:
    input - the underlying child token stream
    synonyms - the map used to extract synonyms for terms
    maxSynonyms - the maximum number of synonym tokens to return per underlying token word (a value of Integer.MAX_VALUE indicates unlimited)
Method from org.apache.lucene.index.memory.SynonymTokenFilter Summary:
createToken,   next
Methods from org.apache.lucene.analysis.TokenFilter:
close
Methods from org.apache.lucene.analysis.TokenStream:
close,   next,   next,   reset
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.lucene.index.memory.SynonymTokenFilter Detail:
 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() throws IOException 
    Returns the next token in the stream, or null at EOS.