public final class StopAnalyzer extends StopwordAnalyzerBase
Analyzer.ReuseStrategy, Analyzer.TokenStreamComponentsstopwordsGLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY| Constructor and Description |
|---|
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, tokenStreampublic 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 LetterTokenizer 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).