org.apache.lucene.analysis.de
Class GermanAnalyzer

java.lang.Object
  extended by org.apache.lucene.analysis.Analyzer
      extended by org.apache.lucene.analysis.de.GermanAnalyzer
All Implemented Interfaces:
Closeable

public class GermanAnalyzer
extends org.apache.lucene.analysis.Analyzer

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.


Field Summary
static String[] GERMAN_STOP_WORDS
          Deprecated. use getDefaultStopSet() instead
 
Fields inherited from class org.apache.lucene.analysis.Analyzer
overridesTokenStreamMethod
 
Constructor Summary
GermanAnalyzer(org.apache.lucene.util.Version matchVersion)
          Builds an analyzer with the default stop words: getDefaultStopSet().
GermanAnalyzer(org.apache.lucene.util.Version matchVersion, File stopwords)
          Deprecated. use GermanAnalyzer(Version, Set)
GermanAnalyzer(org.apache.lucene.util.Version matchVersion, Map<?,?> stopwords)
          Deprecated. use GermanAnalyzer(Version, Set)
GermanAnalyzer(org.apache.lucene.util.Version matchVersion, Set<?> stopwords)
          Builds an analyzer with the given stop words
GermanAnalyzer(org.apache.lucene.util.Version matchVersion, Set<?> stopwords, Set<?> stemExclusionSet)
          Builds an analyzer with the given stop words
GermanAnalyzer(org.apache.lucene.util.Version matchVersion, String... stopwords)
          Deprecated. use GermanAnalyzer(Version, Set)
 
Method Summary
static Set<?> getDefaultStopSet()
          Returns a set of default German-stopwords
 org.apache.lucene.analysis.TokenStream reusableTokenStream(String fieldName, Reader reader)
          Returns a (possibly reused) TokenStream which tokenizes all the text in the provided Reader.
 void setStemExclusionTable(File exclusionlist)
          Deprecated. use GermanAnalyzer(Version, Set, Set) instead
 void setStemExclusionTable(Map exclusionlist)
          Deprecated. use GermanAnalyzer(Version, Set, Set) instead
 void setStemExclusionTable(String[] exclusionlist)
          Deprecated. use GermanAnalyzer(Version, Set, Set) instead
 org.apache.lucene.analysis.TokenStream tokenStream(String fieldName, Reader reader)
          Creates a TokenStream which tokenizes all the text in the provided Reader.
 
Methods inherited from class org.apache.lucene.analysis.Analyzer
close, getOffsetGap, getPositionIncrementGap, getPreviousTokenStream, setOverridesTokenStreamMethod, setPreviousTokenStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GERMAN_STOP_WORDS

public static final String[] GERMAN_STOP_WORDS
Deprecated. use getDefaultStopSet() instead
List of typical german stopwords.

Constructor Detail

GermanAnalyzer

public GermanAnalyzer(org.apache.lucene.util.Version matchVersion)
Builds an analyzer with the default stop words: getDefaultStopSet().


GermanAnalyzer

public GermanAnalyzer(org.apache.lucene.util.Version matchVersion,
                      Set<?> stopwords)
Builds an analyzer with the given stop words

Parameters:
matchVersion - lucene compatibility version
stopwords - a stopword set

GermanAnalyzer

public GermanAnalyzer(org.apache.lucene.util.Version matchVersion,
                      Set<?> stopwords,
                      Set<?> stemExclusionSet)
Builds an analyzer with the given stop words

Parameters:
matchVersion - lucene compatibility version
stopwords - a stopword set
stemExclusionSet - a stemming exclusion set

GermanAnalyzer

public GermanAnalyzer(org.apache.lucene.util.Version matchVersion,
                      String... stopwords)
Deprecated. use GermanAnalyzer(Version, Set)

Builds an analyzer with the given stop words.


GermanAnalyzer

public GermanAnalyzer(org.apache.lucene.util.Version matchVersion,
                      Map<?,?> stopwords)
Deprecated. use GermanAnalyzer(Version, Set)

Builds an analyzer with the given stop words.


GermanAnalyzer

public GermanAnalyzer(org.apache.lucene.util.Version matchVersion,
                      File stopwords)
               throws IOException
Deprecated. use GermanAnalyzer(Version, Set)

Builds an analyzer with the given stop words.

Throws:
IOException
Method Detail

getDefaultStopSet

public static final Set<?> getDefaultStopSet()
Returns a set of default German-stopwords

Returns:
a set of default German-stopwords

setStemExclusionTable

public void setStemExclusionTable(String[] exclusionlist)
Deprecated. use GermanAnalyzer(Version, Set, Set) instead

Builds an exclusionlist from an array of Strings.


setStemExclusionTable

public void setStemExclusionTable(Map exclusionlist)
Deprecated. use GermanAnalyzer(Version, Set, Set) instead

Builds an exclusionlist from a Map


setStemExclusionTable

public void setStemExclusionTable(File exclusionlist)
                           throws IOException
Deprecated. use GermanAnalyzer(Version, Set, Set) instead

Builds an exclusionlist from the words contained in the given file.

Throws:
IOException

tokenStream

public org.apache.lucene.analysis.TokenStream tokenStream(String fieldName,
                                                          Reader reader)
Creates a TokenStream which tokenizes all the text in the provided Reader.

Specified by:
tokenStream in class org.apache.lucene.analysis.Analyzer
Returns:
A TokenStream built from a StandardTokenizer filtered with StandardFilter, LowerCaseFilter, StopFilter, and GermanStemFilter

reusableTokenStream

public org.apache.lucene.analysis.TokenStream reusableTokenStream(String fieldName,
                                                                  Reader reader)
                                                           throws IOException
Returns a (possibly reused) TokenStream which tokenizes all the text in the provided Reader.

Overrides:
reusableTokenStream in class org.apache.lucene.analysis.Analyzer
Returns:
A TokenStream built from a StandardTokenizer filtered with StandardFilter, LowerCaseFilter, StopFilter, and GermanStemFilter
Throws:
IOException


Copyright © 2000-2010 Apache Software Foundation. All Rights Reserved.