FileDocCategorySizeDatePackage
StopAnalyzer.javaAPI DocApache Lucene 1.92477Mon Feb 20 09:19:46 GMT 2006org.apache.lucene.analysis

StopAnalyzer

public final class StopAnalyzer extends Analyzer
Filters LetterTokenizer with LowerCaseFilter and StopFilter.

Fields Summary
private Set
stopWords
public static final String[]
ENGLISH_STOP_WORDS
An array containing some common English words that are not usually useful for searching.
Constructors Summary
public StopAnalyzer()
Builds an analyzer which removes words in ENGLISH_STOP_WORDS.


           
    
    stopWords = StopFilter.makeStopSet(ENGLISH_STOP_WORDS);
  
public StopAnalyzer(Set stopWords)
Builds an analyzer with the stop words from the given set.

    this.stopWords = stopWords;
  
public StopAnalyzer(String[] stopWords)
Builds an analyzer which removes words in the provided array.

    this.stopWords = StopFilter.makeStopSet(stopWords);
  
public StopAnalyzer(File stopwordsFile)
Builds an analyzer with the stop words from the given file.

see
WordlistLoader#getWordSet(File)

    stopWords = WordlistLoader.getWordSet(stopwordsFile);
  
public StopAnalyzer(Reader stopwords)
Builds an analyzer with the stop words from the given reader.

see
WordlistLoader#getWordSet(Reader)

    stopWords = WordlistLoader.getWordSet(stopwords);
  
Methods Summary
public org.apache.lucene.analysis.TokenStreamtokenStream(java.lang.String fieldName, java.io.Reader reader)
Filters LowerCaseTokenizer with StopFilter.

    return new StopFilter(new LowerCaseTokenizer(reader), stopWords);