org.apache.lucene.analysis
Class StopAnalyzer
- java.lang.Object
-
- org.apache.lucene.analysis.Analyzer
-
- org.apache.lucene.analysis.StopAnalyzer
-
public final class StopAnalyzer extends Analyzer
Filters LetterTokenizer with LowerCaseFilter and StopFilter.
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String[]ENGLISH_STOP_WORDSAn array containing some common English words that are not usually useful for searching.
-
Constructor Summary
Constructors Constructor and Description StopAnalyzer()Builds an analyzer which removes words in ENGLISH_STOP_WORDS.StopAnalyzer(java.io.File stopwordsFile)Builds an analyzer with the stop words from the given file.StopAnalyzer(java.io.Reader stopwords)Builds an analyzer with the stop words from the given reader.StopAnalyzer(java.util.Set stopWords)Builds an analyzer with the stop words from the given set.StopAnalyzer(java.lang.String[] stopWords)Builds an analyzer which removes words in the provided array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description TokenStreamreusableTokenStream(java.lang.String fieldName, java.io.Reader reader)Creates a TokenStream that is allowed to be re-used from the previous time that the same thread called this method.TokenStreamtokenStream(java.lang.String fieldName, java.io.Reader reader)Filters LowerCaseTokenizer with StopFilter.-
Methods inherited from class org.apache.lucene.analysis.Analyzer
getPositionIncrementGap
-
-
-
-
Field Detail
-
ENGLISH_STOP_WORDS
public static final java.lang.String[] ENGLISH_STOP_WORDS
An array containing some common English words that are not usually useful for searching.
-
-
Constructor Detail
-
StopAnalyzer
public StopAnalyzer()
Builds an analyzer which removes words in ENGLISH_STOP_WORDS.
-
StopAnalyzer
public StopAnalyzer(java.util.Set stopWords)
Builds an analyzer with the stop words from the given set.
-
StopAnalyzer
public StopAnalyzer(java.lang.String[] stopWords)
Builds an analyzer which removes words in the provided array.
-
StopAnalyzer
public StopAnalyzer(java.io.File stopwordsFile) throws java.io.IOExceptionBuilds an analyzer with the stop words from the given file.- Throws:
java.io.IOException- See Also:
WordlistLoader.getWordSet(File)
-
StopAnalyzer
public StopAnalyzer(java.io.Reader stopwords) throws java.io.IOExceptionBuilds an analyzer with the stop words from the given reader.- Throws:
java.io.IOException- See Also:
WordlistLoader.getWordSet(Reader)
-
-
Method Detail
-
tokenStream
public TokenStream tokenStream(java.lang.String fieldName, java.io.Reader reader)
Filters LowerCaseTokenizer with StopFilter.- Specified by:
tokenStreamin classAnalyzer
-
reusableTokenStream
public TokenStream reusableTokenStream(java.lang.String fieldName, java.io.Reader reader) throws java.io.IOException
Description copied from class:AnalyzerCreates a TokenStream that is allowed to be re-used from the previous time that the same thread called this method. Callers that do not need to use more than one TokenStream at the same time from this analyzer should use this method for better performance.- Overrides:
reusableTokenStreamin classAnalyzer- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG