public final class StopAnalyzer extends StopwordAnalyzerBase
Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents
Modifier and Type | Field and Description |
---|---|
static CharArraySet |
ENGLISH_STOP_WORDS_SET
An unmodifiable set containing some common English words that are not usually useful
for searching.
|
stopwords
GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY
Constructor and Description |
---|
StopAnalyzer()
Builds an analyzer which removes words in
ENGLISH_STOP_WORDS_SET . |
StopAnalyzer(CharArraySet stopWords)
Builds an analyzer with the stop words from the given set.
|
StopAnalyzer(Path stopwordsFile)
Builds an analyzer with the stop words from the given path.
|
StopAnalyzer(Reader stopwords)
Builds an analyzer with the stop words from the given reader.
|
Modifier and Type | Method and Description |
---|---|
protected Analyzer.TokenStreamComponents |
createComponents(String fieldName)
Creates
Analyzer.TokenStreamComponents
used to tokenize all the text in the provided Reader . |
protected TokenStream |
normalize(String fieldName,
TokenStream in) |
getStopwordSet, loadStopwordSet, loadStopwordSet, loadStopwordSet
attributeFactory, close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, getVersion, initReader, initReaderForNormalization, normalize, setVersion, tokenStream, tokenStream
public static final CharArraySet ENGLISH_STOP_WORDS_SET
public StopAnalyzer()
ENGLISH_STOP_WORDS_SET
.public StopAnalyzer(CharArraySet stopWords)
stopWords
- Set of stop wordspublic StopAnalyzer(Path stopwordsFile) throws IOException
stopwordsFile
- File to load stop words fromIOException
WordlistLoader.getWordSet(Reader)
public StopAnalyzer(Reader stopwords) throws IOException
stopwords
- Reader to load stop words fromIOException
WordlistLoader.getWordSet(Reader)
protected Analyzer.TokenStreamComponents createComponents(String fieldName)
Analyzer.TokenStreamComponents
used to tokenize all the text in the provided Reader
.createComponents
in class Analyzer
Analyzer.TokenStreamComponents
built from a LowerCaseTokenizer
filtered with
StopFilter
protected TokenStream normalize(String fieldName, TokenStream in)
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.