|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.analysis.Analyzer
org.apache.lucene.analysis.standard.StandardAnalyzer
public class StandardAnalyzer
Filters StandardTokenizer
with StandardFilter
, LowerCaseFilter
and StopFilter
, using a list of English stop words.
Field Summary | |
---|---|
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 Summary | |
---|---|
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 |
Method Summary | |
---|---|
static boolean |
getDefaultReplaceInvalidAcronym()
Deprecated. This will be removed (hardwired to true) in 3.0 |
int |
getMaxTokenLength()
|
boolean |
isReplaceInvalidAcronym()
Deprecated. This will be removed (hardwired to true) in 3.0 |
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. |
static void |
setDefaultReplaceInvalidAcronym(boolean replaceInvalidAcronym)
Deprecated. This will be removed (hardwired to true) in 3.0 |
void |
setMaxTokenLength(int length)
Set maximum allowed token length. |
void |
setReplaceInvalidAcronym(boolean replaceInvalidAcronym)
Deprecated. This will be removed (hardwired to true) in 3.0 |
TokenStream |
tokenStream(String fieldName,
Reader reader)
Constructs a StandardTokenizer filtered by a StandardFilter , a LowerCaseFilter and a StopFilter . |
Methods inherited from class org.apache.lucene.analysis.Analyzer |
---|
getPositionIncrementGap, getPreviousTokenStream, setPreviousTokenStream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String[] STOP_WORDS
public static final int DEFAULT_MAX_TOKEN_LENGTH
Constructor Detail |
---|
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-1068
IOException
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-1068
IOException
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-1068
IOException
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-1068
IOException
Method Detail |
---|
public static boolean getDefaultReplaceInvalidAcronym()
public static void setDefaultReplaceInvalidAcronym(boolean replaceInvalidAcronym)
replaceInvalidAcronym
- Set to true to have new
instances of StandardTokenizer replace mischaracterized
acronyms by default. Set to false to preseve the
previous (before 2.4) buggy behavior. Alternatively,
set the system property
org.apache.lucene.analysis.standard.StandardAnalyzer.replaceInvalidAcronym
to false.
See https://issues.apache.org/jira/browse/LUCENE-1068public TokenStream tokenStream(String fieldName, Reader reader)
StandardTokenizer
filtered by a StandardFilter
, a LowerCaseFilter
and a StopFilter
.
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-1068
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |