org.apache.lucene.analysis.standard
Class StandardAnalyzer

java.lang.Object
  extended byorg.apache.lucene.analysis.Analyzer
      extended byorg.apache.lucene.analysis.standard.StandardAnalyzer

public class StandardAnalyzer
extends Analyzer

Filters StandardTokenizer with StandardFilter, LowerCaseFilter and StopFilter, using a list of English stop words.

Version:
$Id: StandardAnalyzer.java 219090 2005-07-14 20:36:28Z dnaber $

Field Summary
static String[] STOP_WORDS
          An array containing some common English words that are usually not useful for searching.
 
Constructor Summary
StandardAnalyzer()
          Builds an analyzer with the default stop words (STOP_WORDS).
StandardAnalyzer(File stopwords)
          Builds an analyzer with the stop words from the given file.
StandardAnalyzer(Reader stopwords)
          Builds an analyzer with the stop words from the given reader.
StandardAnalyzer(Set stopWords)
          Builds an analyzer with the given stop words.
StandardAnalyzer(String[] stopWords)
          Builds an analyzer with the given stop words.
 
Method Summary
 TokenStream tokenStream(String fieldName, Reader reader)
          Constructs a StandardTokenizer filtered by a StandardFilter, a LowerCaseFilter and a StopFilter.
 
Methods inherited from class org.apache.lucene.analysis.Analyzer
getPositionIncrementGap, tokenStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STOP_WORDS

public static final String[] STOP_WORDS
An array containing some common English words that are usually not useful for searching.

Constructor Detail

StandardAnalyzer

public StandardAnalyzer()
Builds an analyzer with the default stop words (STOP_WORDS).


StandardAnalyzer

public StandardAnalyzer(Set stopWords)
Builds an analyzer with the given stop words.


StandardAnalyzer

public StandardAnalyzer(String[] stopWords)
Builds an analyzer with the given stop words.


StandardAnalyzer

public StandardAnalyzer(File stopwords)
                 throws IOException
Builds an analyzer with the stop words from the given file.

See Also:
WordlistLoader.getWordSet(File)

StandardAnalyzer

public StandardAnalyzer(Reader stopwords)
                 throws IOException
Builds an analyzer with the stop words from the given reader.

See Also:
WordlistLoader.getWordSet(Reader)
Method Detail

tokenStream

public TokenStream tokenStream(String fieldName,
                               Reader reader)
Constructs a StandardTokenizer filtered by a StandardFilter, a LowerCaseFilter and a StopFilter.

Overrides:
tokenStream in class Analyzer


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