StandardAnalyzerpublic class StandardAnalyzer extends Analyzer Filters {@link StandardTokenizer} with {@link StandardFilter}, {@link
LowerCaseFilter} and {@link StopFilter}, using a list of English stop words. |
Fields Summary |
---|
private Set | stopSet | public static final String[] | STOP_WORDSAn array containing some common English words that are usually not
useful for searching. |
Constructors Summary |
---|
public StandardAnalyzer()Builds an analyzer with the default stop words ({@link #STOP_WORDS}).
this(STOP_WORDS);
| public StandardAnalyzer(Set stopWords)Builds an analyzer with the given stop words.
stopSet = stopWords;
| public StandardAnalyzer(String[] stopWords)Builds an analyzer with the given stop words.
stopSet = StopFilter.makeStopSet(stopWords);
| public StandardAnalyzer(File stopwords)Builds an analyzer with the stop words from the given file.
stopSet = WordlistLoader.getWordSet(stopwords);
| public StandardAnalyzer(Reader stopwords)Builds an analyzer with the stop words from the given reader.
stopSet = WordlistLoader.getWordSet(stopwords);
|
Methods Summary |
---|
public org.apache.lucene.analysis.TokenStream | tokenStream(java.lang.String fieldName, java.io.Reader reader)Constructs a {@link StandardTokenizer} filtered by a {@link
StandardFilter}, a {@link LowerCaseFilter} and a {@link StopFilter}.
TokenStream result = new StandardTokenizer(reader);
result = new StandardFilter(result);
result = new LowerCaseFilter(result);
result = new StopFilter(result, stopSet);
return result;
|
|