public final class FrenchAnalyzer
extends org.apache.lucene.analysis.Analyzer
Analyzer
for French language.
Supports an external list of stopwords (words that will not be indexed at all) and an external list of exclusions (word that will not be stemmed, but indexed). A default set of stopwords is used unless an alternative list is specified, but the exclusion list is empty by default.
You must specify the required Version
compatibility when creating FrenchAnalyzer:
NOTE: This class uses the same Version
dependent settings as StandardAnalyzer
.
Modifier and Type | Field and Description |
---|---|
static java.lang.String[] |
FRENCH_STOP_WORDS
Extended list of typical French stopwords.
|
Constructor and Description |
---|
FrenchAnalyzer()
Deprecated.
Use
FrenchAnalyzer(Version) instead. |
FrenchAnalyzer(java.io.File stopwords)
Deprecated.
Use
FrenchAnalyzer(Version, File) instead |
FrenchAnalyzer(java.lang.String[] stopwords)
Deprecated.
Use
FrenchAnalyzer(Version,
String[]) instead. |
FrenchAnalyzer(org.apache.lucene.util.Version matchVersion)
Builds an analyzer with the default stop words (
FRENCH_STOP_WORDS ). |
FrenchAnalyzer(org.apache.lucene.util.Version matchVersion,
java.io.File stopwords)
Builds an analyzer with the given stop words.
|
FrenchAnalyzer(org.apache.lucene.util.Version matchVersion,
java.lang.String[] stopwords)
Builds an analyzer with the given stop words.
|
Modifier and Type | Method and Description |
---|---|
org.apache.lucene.analysis.TokenStream |
reusableTokenStream(java.lang.String fieldName,
java.io.Reader reader)
Returns a (possibly reused)
TokenStream which tokenizes all the
text in the provided Reader . |
void |
setStemExclusionTable(java.io.File exclusionlist)
Builds an exclusionlist from the words contained in the given file.
|
void |
setStemExclusionTable(java.util.Map exclusionlist)
Builds an exclusionlist from a Map.
|
void |
setStemExclusionTable(java.lang.String[] exclusionlist)
Builds an exclusionlist from an array of Strings.
|
org.apache.lucene.analysis.TokenStream |
tokenStream(java.lang.String fieldName,
java.io.Reader reader)
Creates a
TokenStream which tokenizes all the text in the provided
Reader . |
public static final java.lang.String[] FRENCH_STOP_WORDS
public FrenchAnalyzer()
FrenchAnalyzer(Version)
instead.FRENCH_STOP_WORDS
).public FrenchAnalyzer(org.apache.lucene.util.Version matchVersion)
FRENCH_STOP_WORDS
).public FrenchAnalyzer(java.lang.String[] stopwords)
FrenchAnalyzer(Version,
String[])
instead.public FrenchAnalyzer(org.apache.lucene.util.Version matchVersion, java.lang.String[] stopwords)
public FrenchAnalyzer(java.io.File stopwords) throws java.io.IOException
FrenchAnalyzer(Version, File)
insteadjava.io.IOException
public FrenchAnalyzer(org.apache.lucene.util.Version matchVersion, java.io.File stopwords) throws java.io.IOException
java.io.IOException
public void setStemExclusionTable(java.lang.String[] exclusionlist)
public void setStemExclusionTable(java.util.Map exclusionlist)
public void setStemExclusionTable(java.io.File exclusionlist) throws java.io.IOException
java.io.IOException
public final org.apache.lucene.analysis.TokenStream tokenStream(java.lang.String fieldName, java.io.Reader reader)
TokenStream
which tokenizes all the text in the provided
Reader
.tokenStream
in class org.apache.lucene.analysis.Analyzer
TokenStream
built from a StandardTokenizer
filtered with StandardFilter
, StopFilter
,
FrenchStemFilter
and LowerCaseFilter
public org.apache.lucene.analysis.TokenStream reusableTokenStream(java.lang.String fieldName, java.io.Reader reader) throws java.io.IOException
TokenStream
which tokenizes all the
text in the provided Reader
.reusableTokenStream
in class org.apache.lucene.analysis.Analyzer
TokenStream
built from a StandardTokenizer
filtered with StandardFilter
, StopFilter
,
FrenchStemFilter
and LowerCaseFilter
java.io.IOException
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.