org.apache.lucene.analysis.nl

Class 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, the exclusion list is empty by default.

Author: Edwin de Jonge

Field Summary
static String[]DUTCH_STOP_WORDS
List of typical Dutch stopwords.
Constructor Summary
DutchAnalyzer()
Builds an analyzer with the default stop words ({@link #DUTCH_STOP_WORDS}).
DutchAnalyzer(String[] stopwords)
Builds an analyzer with the given stop words.
DutchAnalyzer(HashSet stopwords)
Builds an analyzer with the given stop words.
DutchAnalyzer(File stopwords)
Builds an analyzer with the given stop words.
Method Summary
voidsetStemDictionary(File stemdict)
Reads a stemdictionary file , that overrules the stemming algorithm This is a textfile that contains per line word\tstem i.e: tabseperated
voidsetStemExclusionTable(String[] exclusionlist)
Builds an exclusionlist from an array of Strings.
voidsetStemExclusionTable(HashSet exclusionlist)
Builds an exclusionlist from a Hashtable.
voidsetStemExclusionTable(File exclusionlist)
Builds an exclusionlist from the words contained in the given file.
TokenStreamtokenStream(String fieldName, Reader reader)
Creates a TokenStream which tokenizes all the text in the provided TextReader.

Field Detail

DUTCH_STOP_WORDS

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

Constructor Detail

DutchAnalyzer

public DutchAnalyzer()
Builds an analyzer with the default stop words ({@link #DUTCH_STOP_WORDS}).

DutchAnalyzer

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

Parameters: stopwords

DutchAnalyzer

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

Parameters: stopwords

DutchAnalyzer

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

Parameters: stopwords

Method Detail

setStemDictionary

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

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.

tokenStream

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

Returns: A TokenStream build from a StandardTokenizer filtered with StandardFilter, StopFilter, DutchStemFilter

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