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
All Implemented Interfaces:
Closeable

public final 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 1060847 2011-01-19 16:16:18Z 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
 boolean incrementToken()
           
 void reset()
           
 
Methods inherited from class org.apache.lucene.analysis.TokenFilter
close, end
 
Methods inherited from class org.apache.lucene.util.AttributeSource
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, 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

incrementToken

public boolean incrementToken()
                       throws IOException
Specified by:
incrementToken in class TokenStream
Throws:
IOException

reset

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


Copyright © 2011 Apache Software Foundation. All Rights Reserved.