public final class StopAnalyzer extends StopwordAnalyzerBase
LetterTokenizer
with LowerCaseFilter
and StopFilter
.
You may specify the Version
compatibility when creating StopAnalyzer:
Analyzer.GlobalReuseStrategy, Analyzer.PerFieldReuseStrategy, 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(File stopwordsFile)
Builds an analyzer with the stop words from the given file.
|
StopAnalyzer(Reader stopwords)
Builds an analyzer with the stop words from the given reader.
|
StopAnalyzer(Version matchVersion)
Deprecated.
Use
StopAnalyzer() |
StopAnalyzer(Version matchVersion,
CharArraySet stopWords)
Deprecated.
|
StopAnalyzer(Version matchVersion,
File stopwordsFile)
Deprecated.
|
StopAnalyzer(Version matchVersion,
Reader stopwords)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected Analyzer.TokenStreamComponents |
createComponents(String fieldName,
Reader reader)
Creates
Analyzer.TokenStreamComponents
used to tokenize all the text in the provided Reader . |
getStopwordSet, loadStopwordSet, loadStopwordSet, loadStopwordSet, loadStopwordSet, loadStopwordSet
close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, getVersion, initReader, setVersion, tokenStream, tokenStream
public static final CharArraySet ENGLISH_STOP_WORDS_SET
public StopAnalyzer()
ENGLISH_STOP_WORDS_SET
.@Deprecated public StopAnalyzer(Version matchVersion)
StopAnalyzer()
public StopAnalyzer(CharArraySet stopWords)
stopWords
- Set of stop words@Deprecated public StopAnalyzer(Version matchVersion, CharArraySet stopWords)
StopAnalyzer(CharArraySet)
public StopAnalyzer(File stopwordsFile) throws IOException
stopwordsFile
- File to load stop words fromIOException
WordlistLoader.getWordSet(Reader)
@Deprecated public StopAnalyzer(Version matchVersion, File stopwordsFile) throws IOException
StopAnalyzer(File)
IOException
public StopAnalyzer(Reader stopwords) throws IOException
stopwords
- Reader to load stop words fromIOException
WordlistLoader.getWordSet(Reader)
@Deprecated public StopAnalyzer(Version matchVersion, Reader stopwords) throws IOException
StopAnalyzer(Reader)
IOException
protected Analyzer.TokenStreamComponents createComponents(String fieldName, Reader reader)
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
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.