org.apache.lucene.analysis.nl
Class DutchAnalyzer

java.lang.Object
  extended by org.apache.lucene.analysis.Analyzer
      extended by org.apache.lucene.analysis.nl.DutchAnalyzer

public class DutchAnalyzer
extends Analyzer

Analyzer for Dutch language.

Supports an external list of stopwords (words that will not be indexed at all), an external list of exclusions (word that will not be stemmed, but indexed) and an external list of word-stem pairs that overrule the algorithm (dictionary stemming). 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[] DUTCH_STOP_WORDS
          List of typical Dutch stopwords.
 
Fields inherited from class org.apache.lucene.analysis.Analyzer
overridesTokenStreamMethod
 
Constructor Summary
DutchAnalyzer()
          Deprecated. Use DutchAnalyzer(Version) instead
DutchAnalyzer(File stopwords)
          Deprecated. Use DutchAnalyzer(Version, File) instead
DutchAnalyzer(HashSet stopwords)
          Deprecated. Use DutchAnalyzer(Version, HashSet) instead
DutchAnalyzer(String[] stopwords)
          Deprecated. Use DutchAnalyzer(Version, String[]) instead
DutchAnalyzer(Version matchVersion)
          Builds an analyzer with the default stop words (DUTCH_STOP_WORDS) and a few default entries for the stem exclusion table.
DutchAnalyzer(Version matchVersion, File stopwords)
          Builds an analyzer with the given stop words.
DutchAnalyzer(Version matchVersion, HashSet stopwords)
          Builds an analyzer with the given stop words.
DutchAnalyzer(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 setStemDictionary(File stemdictFile)
          Reads a stemdictionary file , that overrules the stemming algorithm This is a textfile that contains per line word\tstem, i.e: two tab seperated words
 void setStemExclusionTable(File exclusionlist)
          Builds an exclusionlist from the words contained in the given file.
 void setStemExclusionTable(HashSet exclusionlist)
          Builds an exclusionlist from a Hashtable.
 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

DUTCH_STOP_WORDS

public static final String[] DUTCH_STOP_WORDS
List of typical Dutch stopwords.

Constructor Detail

DutchAnalyzer

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

Builds an analyzer with the default stop words (DUTCH_STOP_WORDS) and a few default entries for the stem exclusion table.


DutchAnalyzer

public DutchAnalyzer(Version matchVersion)
Builds an analyzer with the default stop words (DUTCH_STOP_WORDS) and a few default entries for the stem exclusion table.


DutchAnalyzer

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

Builds an analyzer with the given stop words.

Parameters:
stopwords -

DutchAnalyzer

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

Parameters:
matchVersion -
stopwords -

DutchAnalyzer

public DutchAnalyzer(HashSet stopwords)
Deprecated. Use DutchAnalyzer(Version, HashSet) instead

Builds an analyzer with the given stop words.

Parameters:
stopwords -

DutchAnalyzer

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

Parameters:
stopwords -

DutchAnalyzer

public DutchAnalyzer(File stopwords)
Deprecated. Use DutchAnalyzer(Version, File) instead

Builds an analyzer with the given stop words.

Parameters:
stopwords -

DutchAnalyzer

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

Parameters:
stopwords -
Method Detail

setStemExclusionTable

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

Parameters:
exclusionlist -

setStemExclusionTable

public void setStemExclusionTable(HashSet exclusionlist)
Builds an exclusionlist from a Hashtable.


setStemExclusionTable

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


setStemDictionary

public void setStemDictionary(File stemdictFile)
Reads a stemdictionary file , that overrules the stemming algorithm This is a textfile that contains per line word\tstem, i.e: two tab seperated words


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, StopFilter, and DutchStemFilter

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, StopFilter, and DutchStemFilter
Throws:
IOException


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