org.apache.lucene.analysis.standard
public class StandardAnalyzer extends Analyzer
StandardTokenizer
with StandardFilter
, LowerCaseFilter
and StopFilter
, using a list of English stop words.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_TOKEN_LENGTH
Default maximum allowed token length
|
static String[] |
STOP_WORDS
An array containing some common English words that are usually not
useful for searching.
|
Constructor and Description |
---|
StandardAnalyzer()
Builds an analyzer with the default stop words (
STOP_WORDS ). |
StandardAnalyzer(boolean replaceInvalidAcronym)
Deprecated.
Remove in 3.X and make true the only valid value
|
StandardAnalyzer(File stopwords)
Builds an analyzer with the stop words from the given file.
|
StandardAnalyzer(File stopwords,
boolean replaceInvalidAcronym)
Deprecated.
Remove in 3.X and make true the only valid value
|
StandardAnalyzer(Reader stopwords)
Builds an analyzer with the stop words from the given reader.
|
StandardAnalyzer(Reader stopwords,
boolean replaceInvalidAcronym)
Deprecated.
Remove in 3.X and make true the only valid value
|
StandardAnalyzer(Set stopWords)
Builds an analyzer with the given stop words.
|
StandardAnalyzer(Set stopwords,
boolean replaceInvalidAcronym)
Deprecated.
Remove in 3.X and make true the only valid value
|
StandardAnalyzer(String[] stopWords)
Builds an analyzer with the given stop words.
|
StandardAnalyzer(String[] stopwords,
boolean replaceInvalidAcronym)
Deprecated.
Remove in 3.X and make true the only valid value
|
Modifier and Type | Method and Description |
---|---|
int |
getMaxTokenLength() |
boolean |
isReplaceInvalidAcronym() |
TokenStream |
reusableTokenStream(String fieldName,
Reader reader)
Creates a TokenStream that is allowed to be re-used
from the previous time that the same thread called
this method.
|
void |
setMaxTokenLength(int length)
Set maximum allowed token length.
|
void |
setReplaceInvalidAcronym(boolean replaceInvalidAcronym) |
TokenStream |
tokenStream(String fieldName,
Reader reader)
|
getPositionIncrementGap, getPreviousTokenStream, setPreviousTokenStream
public static final String[] STOP_WORDS
public static final int DEFAULT_MAX_TOKEN_LENGTH
public StandardAnalyzer()
STOP_WORDS
).public StandardAnalyzer(Set stopWords)
public StandardAnalyzer(String[] stopWords)
public StandardAnalyzer(File stopwords) throws IOException
IOException
WordlistLoader.getWordSet(File)
public StandardAnalyzer(Reader stopwords) throws IOException
IOException
WordlistLoader.getWordSet(Reader)
public StandardAnalyzer(boolean replaceInvalidAcronym)
replaceInvalidAcronym
- Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer
See https://issues.apache.org/jira/browse/LUCENE-1068public StandardAnalyzer(Reader stopwords, boolean replaceInvalidAcronym) throws IOException
stopwords
- The stopwords to usereplaceInvalidAcronym
- Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer
See https://issues.apache.org/jira/browse/LUCENE-1068IOException
public StandardAnalyzer(File stopwords, boolean replaceInvalidAcronym) throws IOException
stopwords
- The stopwords to usereplaceInvalidAcronym
- Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer
See https://issues.apache.org/jira/browse/LUCENE-1068IOException
public StandardAnalyzer(String[] stopwords, boolean replaceInvalidAcronym) throws IOException
stopwords
- The stopwords to usereplaceInvalidAcronym
- Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer
See https://issues.apache.org/jira/browse/LUCENE-1068IOException
public StandardAnalyzer(Set stopwords, boolean replaceInvalidAcronym) throws IOException
stopwords
- The stopwords to usereplaceInvalidAcronym
- Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer
See https://issues.apache.org/jira/browse/LUCENE-1068IOException
public TokenStream tokenStream(String fieldName, Reader reader)
tokenStream
in class Analyzer
public void setMaxTokenLength(int length)
public int getMaxTokenLength()
setMaxTokenLength(int)
public TokenStream reusableTokenStream(String fieldName, Reader reader) throws IOException
Analyzer
reusableTokenStream
in class Analyzer
IOException
public boolean isReplaceInvalidAcronym()
public void setReplaceInvalidAcronym(boolean replaceInvalidAcronym)
replaceInvalidAcronym
- Set to true if this Analyzer is replacing mischaracterized acronyms in the StandardTokenizer
See https://issues.apache.org/jira/browse/LUCENE-1068Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.