public final class GermanAnalyzer extends StopwordAnalyzerBase
Analyzer
for German 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.
NOTE: This class uses the same Version
dependent settings as StandardAnalyzer
.
Analyzer.ReuseStrategy, Analyzer.TokenStreamComponents
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_STOPWORD_FILE
File containing default German stopwords.
|
stopwords
GLOBAL_REUSE_STRATEGY, PER_FIELD_REUSE_STRATEGY
Constructor and Description |
---|
GermanAnalyzer()
Builds an analyzer with the default stop words:
getDefaultStopSet() . |
GermanAnalyzer(CharArraySet stopwords)
Builds an analyzer with the given stop words
|
GermanAnalyzer(CharArraySet stopwords,
CharArraySet stemExclusionSet)
Builds an analyzer with the given stop words
|
Modifier and Type | Method and Description |
---|---|
protected Analyzer.TokenStreamComponents |
createComponents(String fieldName)
Creates
Analyzer.TokenStreamComponents
used to tokenize all the text in the provided Reader . |
static CharArraySet |
getDefaultStopSet()
Returns a set of default German-stopwords
|
protected TokenStream |
normalize(String fieldName,
TokenStream in) |
getStopwordSet, loadStopwordSet, loadStopwordSet, loadStopwordSet
attributeFactory, close, getOffsetGap, getPositionIncrementGap, getReuseStrategy, getVersion, initReader, initReaderForNormalization, normalize, setVersion, tokenStream, tokenStream
public static final String DEFAULT_STOPWORD_FILE
public GermanAnalyzer()
getDefaultStopSet()
.public GermanAnalyzer(CharArraySet stopwords)
stopwords
- a stopword setpublic GermanAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet)
stopwords
- a stopword setstemExclusionSet
- a stemming exclusion setpublic static final CharArraySet getDefaultStopSet()
protected Analyzer.TokenStreamComponents createComponents(String fieldName)
Analyzer.TokenStreamComponents
used to tokenize all the text in the provided Reader
.createComponents
in class Analyzer
Analyzer.TokenStreamComponents
built from a StandardTokenizer
filtered with
LowerCaseFilter
, StopFilter
, SetKeywordMarkerFilter
if a stem exclusion set is
provided, GermanNormalizationFilter
and GermanLightStemFilter
protected TokenStream normalize(String fieldName, TokenStream in)
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.