public final class StopAnalyzer extends StopwordAnalyzerBase
Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents| Modifier and Type | Field and Description |
|---|---|
static CharArraySet |
ENGLISH_STOP_WORDS_SET
Deprecated.
|
stopwordsGLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY| Constructor and Description |
|---|
StopAnalyzer()
Deprecated.
Use a constructor with a specific stop word set
|
StopAnalyzer(CharArraySet stopWords)
Builds an analyzer with the stop words from the given set.
|
StopAnalyzer(java.nio.file.Path stopwordsFile)
Builds an analyzer with the stop words from the given path.
|
StopAnalyzer(java.io.Reader stopwords)
Builds an analyzer with the stop words from the given reader.
|
| Modifier and Type | Method and Description |
|---|---|
protected Analyzer.TokenStreamComponents |
createComponents(java.lang.String fieldName)
Creates
Analyzer.TokenStreamComponents
used to tokenize all the text in the provided Reader. |
protected TokenStream |
normalize(java.lang.String fieldName,
TokenStream in)
Wrap the given
TokenStream in order to apply normalization filters. |
getStopwordSet, loadStopwordSet, loadStopwordSet, loadStopwordSetattributeFactory, close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, getVersion, initReader, initReaderForNormalization, normalize, setVersion, tokenStream, tokenStream@Deprecated public static final CharArraySet ENGLISH_STOP_WORDS_SET
@Deprecated public StopAnalyzer()
ENGLISH_STOP_WORDS_SET.public StopAnalyzer(CharArraySet stopWords)
stopWords - Set of stop wordspublic StopAnalyzer(java.nio.file.Path stopwordsFile)
throws java.io.IOException
stopwordsFile - File to load stop words fromjava.io.IOExceptionWordlistLoader.getWordSet(Reader)public StopAnalyzer(java.io.Reader stopwords)
throws java.io.IOException
stopwords - Reader to load stop words fromjava.io.IOExceptionWordlistLoader.getWordSet(Reader)protected Analyzer.TokenStreamComponents createComponents(java.lang.String fieldName)
Analyzer.TokenStreamComponents
used to tokenize all the text in the provided Reader.createComponents in class AnalyzerfieldName - the name of the fields content passed to the
Analyzer.TokenStreamComponents sink as a readerAnalyzer.TokenStreamComponents
built from a LowerCaseTokenizer filtered with
StopFilterprotected TokenStream normalize(java.lang.String fieldName, TokenStream in)
AnalyzerTokenStream in order to apply normalization filters.
The default implementation returns the TokenStream as-is. This is
used by Analyzer.normalize(String, String).Copyright © 2000–2025 The Apache Software Foundation. All rights reserved.