com.lucene.analysis
Class StopFilter

java.lang.Object
  |
  +--com.lucene.analysis.TokenStream
        |
        +--com.lucene.analysis.TokenFilter
              |
              +--com.lucene.analysis.StopFilter

public final class StopFilter
extends TokenFilter

Removes stop words from a token stream.


Fields inherited from class com.lucene.analysis.TokenFilter
input
 
Constructor Summary
StopFilter(TokenStream in, Hashtable stopTable)
          Constructs a filter which removes words from the input TokenStream that are named in the Hashtable.
StopFilter(TokenStream in, String[] stopWords)
          Constructs a filter which removes words from the input TokenStream that are named in the array of words.
 
Method Summary
static Hashtable makeStopTable(String[] stopWords)
          Builds a Hashtable from an array of stop words, appropriate for passing into the StopFilter constructor.
 Token next()
          Returns the next input Token whose termText() is not a stop word.
 
Methods inherited from class com.lucene.analysis.TokenFilter
close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StopFilter

public StopFilter(TokenStream in,
                  String[] stopWords)
Constructs a filter which removes words from the input TokenStream that are named in the array of words.

StopFilter

public StopFilter(TokenStream in,
                  Hashtable stopTable)
Constructs a filter which removes words from the input TokenStream that are named in the Hashtable.
Method Detail

makeStopTable

public static final Hashtable makeStopTable(String[] stopWords)
Builds a Hashtable from an array of stop words, appropriate for passing into the StopFilter constructor. This permits this table construction to be cached once when an Analyzer is constructed.

next

public final Token next()
                 throws IOException
Returns the next input Token whose termText() is not a stop word.
Overrides:
next in class TokenStream