Save This Page
Home » lucene-2.3.2-src » org.apache » lucene » analysis » [javadoc | source]
org.apache.lucene.analysis
public final class: StopFilter [javadoc | source]
java.lang.Object
   org.apache.lucene.analysis.TokenStream
      org.apache.lucene.analysis.TokenFilter
         org.apache.lucene.analysis.StopFilter
Removes stop words from a token stream.
Fields inherited from org.apache.lucene.analysis.TokenFilter:
input
Constructor:
 public StopFilter(TokenStream input,
    String[] stopWords) 
    Construct a token stream filtering the given input.
 public StopFilter(TokenStream in,
    Set stopWords) 
    Constructs a filter which removes words from the input TokenStream that are named in the Set.
 public StopFilter(TokenStream in,
    String[] stopWords,
    boolean ignoreCase) 
    Constructs a filter which removes words from the input TokenStream that are named in the array of words.
 public StopFilter(TokenStream input,
    Set stopWords,
    boolean ignoreCase) 
    Construct a token stream filtering the given input. If stopWords is an instance of CharArraySet (true if makeStopSet() was used to construct the set) it will be directly used and ignoreCase will be ignored since CharArraySet directly controls case sensitivity.

    If stopWords is not an instance of CharArraySet , a new CharArraySet will be constructed and ignoreCase will be used to specify the case sensitivity of that set.

    Parameters:
    input -
    stopWords - The set of Stop Words.
    ignoreCase - -Ignore case when stopping.
Method from org.apache.lucene.analysis.StopFilter Summary:
getEnablePositionIncrements,   getEnablePositionIncrementsDefault,   makeStopSet,   makeStopSet,   next,   setEnablePositionIncrements,   setEnablePositionIncrementsDefault
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.analysis.StopFilter Detail:
 public boolean getEnablePositionIncrements() 
 public static boolean getEnablePositionIncrementsDefault() 
 public static final Set makeStopSet(String[] stopWords) 
    Builds a Set from an array of stop words, appropriate for passing into the StopFilter constructor. This permits this stopWords construction to be cached once when an Analyzer is constructed.
 public static final Set makeStopSet(String[] stopWords,
    boolean ignoreCase) 
 public final Token next(Token result) throws IOException 
    Returns the next input Token whose termText() is not a stop word.
 public  void setEnablePositionIncrements(boolean enable) 
    Set to true to make this StopFilter enable position increments to result tokens.

    When set, when a token is stopped (omitted), the position increment of the following token is incremented.

    Default: see #setEnablePositionIncrementsDefault(boolean) .

 public static  void setEnablePositionIncrementsDefault(boolean defaultValue) 
    Set the default position increments behavior of every StopFilter created from now on.

    Note: behavior of a single StopFilter instance can be modified with #setEnablePositionIncrements(boolean) . This static method allows control over behavior of classes using StopFilters internally, for example StandardAnalyzer .

    Default : false.