org.apache.solr.analysis
Class SynonymFilter

java.lang.Object
  extended by org.apache.lucene.util.AttributeSource
      extended by org.apache.lucene.analysis.TokenStream
          extended by org.apache.lucene.analysis.TokenFilter
              extended by org.apache.solr.analysis.SynonymFilter

public class SynonymFilter
extends TokenFilter

SynonymFilter handles multi-token synonyms with variable position increment offsets.

The matched tokens from the input stream may be optionally passed through (includeOrig=true) or discarded. If the original tokens are included, the position increments may be modified to retain absolute positions after merging with the synonym tokenstream.

Generated synonyms will start at the same position as the first matched source token.

Version:
$Id: SynonymFilter.java 804726 2009-08-16 17:28:58Z yonik $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.util.AttributeSource
AttributeSource.AttributeFactory, AttributeSource.State
 
Field Summary
 
Fields inherited from class org.apache.lucene.analysis.TokenFilter
input
 
Constructor Summary
SynonymFilter(TokenStream in, SynonymMap map)
           
 
Method Summary
 Token next(Token target)
           
 void reset()
           
 
Methods inherited from class org.apache.lucene.analysis.TokenFilter
close, end
 
Methods inherited from class org.apache.lucene.analysis.TokenStream
getOnlyUseNewAPI, incrementToken, next, setOnlyUseNewAPI
 
Methods inherited from class org.apache.lucene.util.AttributeSource
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, restoreState, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SynonymFilter

public SynonymFilter(TokenStream in,
                     SynonymMap map)
Method Detail

next

public Token next(Token target)
           throws IOException
Overrides:
next in class TokenStream
Throws:
IOException

reset

public void reset()
           throws IOException
Overrides:
reset in class TokenFilter
Throws:
IOException


Copyright © 2010 Apache Software Foundation. All Rights Reserved.