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

public class GermanAnalyzer
extends 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.

Version:
$Id: GermanAnalyzer.java 829816 2009-10-26 14:49:39Z mikemccand $

Field Summary
static String[] GERMAN_STOP_WORDS
          List of typical german stopwords.
 
Fields inherited from class org.apache.lucene.analysis.Analyzer
overridesTokenStreamMethod
 
Constructor Summary
GermanAnalyzer()
          Deprecated. Use GermanAnalyzer(Version) instead
GermanAnalyzer(File stopwords)
          Deprecated. Use GermanAnalyzer(Version, File) instead
GermanAnalyzer(Map stopwords)
          Deprecated. Use GermanAnalyzer(Version, Map) instead
GermanAnalyzer(String[] stopwords)
          Deprecated. Use GermanAnalyzer(Version, String[]) instead
GermanAnalyzer(Version matchVersion)
          Builds an analyzer with the default stop words: GERMAN_STOP_WORDS.
GermanAnalyzer(Version matchVersion, File stopwords)
          Builds an analyzer with the given stop words.
GermanAnalyzer(Version matchVersion, Map stopwords)
          Builds an analyzer with the given stop words.
GermanAnalyzer(Version matchVersion, String[] stopwords)
          Builds an analyzer with the given stop words.
 
Method Summary
 TokenStream reusableTokenStream(String fieldName, Reader reader)
          Returns a (possibly reused) TokenStream which tokenizes all the text in the provided Reader.
 void setStemExclusionTable(File exclusionlist)
          Builds an exclusionlist from the words contained in the given file.
 void setStemExclusionTable(Map exclusionlist)
          Builds an exclusionlist from a Map
 void setStemExclusionTable(String[] exclusionlist)
          Builds an exclusionlist from an array of Strings.
 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
List of typical german stopwords.

Constructor Detail

GermanAnalyzer

public GermanAnalyzer()
Deprecated. Use GermanAnalyzer(Version) instead

Builds an analyzer with the default stop words: GERMAN_STOP_WORDS.


GermanAnalyzer

public GermanAnalyzer(Version matchVersion)
Builds an analyzer with the default stop words: GERMAN_STOP_WORDS.


GermanAnalyzer

public GermanAnalyzer(String[] stopwords)
Deprecated. Use GermanAnalyzer(Version, String[]) instead

Builds an analyzer with the given stop words.


GermanAnalyzer

public GermanAnalyzer(Version matchVersion,
                      String[] stopwords)
Builds an analyzer with the given stop words.


GermanAnalyzer

public GermanAnalyzer(Map stopwords)
Deprecated. Use GermanAnalyzer(Version, Map) instead

Builds an analyzer with the given stop words.


GermanAnalyzer

public GermanAnalyzer(Version matchVersion,
                      Map stopwords)
Builds an analyzer with the given stop words.


GermanAnalyzer

public GermanAnalyzer(File stopwords)
               throws IOException
Deprecated. Use GermanAnalyzer(Version, File) instead

Builds an analyzer with the given stop words.

Throws:
IOException

GermanAnalyzer

public GermanAnalyzer(Version matchVersion,
                      File stopwords)
               throws IOException
Builds an analyzer with the given stop words.

Throws:
IOException
Method Detail

setStemExclusionTable

public void setStemExclusionTable(String[] exclusionlist)
Builds an exclusionlist from an array of Strings.


setStemExclusionTable

public void setStemExclusionTable(Map exclusionlist)
Builds an exclusionlist from a Map


setStemExclusionTable

public void setStemExclusionTable(File exclusionlist)
                           throws IOException
Builds an exclusionlist from the words contained in the given file.

Throws:
IOException

tokenStream

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

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

reusableTokenStream

public 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 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.