Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.lucene.analysis
Class StopFilter

    java.lang.Object
      org.apache.lucene.analysis.TokenStream
          org.apache.lucene.analysis.TokenFilter
              org.apache.lucene.analysis.StopFilter

public final class StopFilter
extends TokenFilter

Removes stop words from a token stream.

Field Summary

Fields inherited from class org.apache.lucene.analysis.TokenFilter
`input`

Constructor Summary
`StopFilter(TokenStream in, Hashtable stopTable)` Deprecated. Use `StopFilter(TokenStream, Set)` instead
`StopFilter(TokenStream in, Set stopWords)` Constructs a filter which removes words from the input TokenStream that are named in the Set.
`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 Set` | `makeStopSet(String[] stopWords)` Builds a Set from an array of stop words, appropriate for passing into the StopFilter constructor.
`static Hashtable` | `makeStopTable(String[] stopWords)` Deprecated. Use `makeStopSet(String[])` instead.
`Token` | `next()` Returns the next input Token whose termText() is not a stop word.

Methods inherited from class org.apache.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)

  Deprecated. Use `StopFilter(TokenStream, Set)` instead

  Constructs a filter which removes words from the input TokenStream that are named in the Hashtable.

### StopFilter

    public StopFilter(TokenStream in,
                      Set stopWords)

  Constructs a filter which removes words from the input TokenStream that are named in the Set. It is crucial that an efficient Set implementation is used for maximum performance.

See Also:
  `makeStopSet(java.lang.String[])`

Method Detail

### makeStopTable

    public static final Hashtable makeStopTable(String[] stopWords)

  Deprecated. Use `makeStopSet(String[])` instead.

  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.

### makeStopSet

    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.

### next

    public final Token next()
                     throws IOException

  Returns the next input Token whose termText() is not a stop word.

  Specified by:
    `next` in class `TokenStream`
  Throws:
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.