org.apache.lucene.analysis.cz

Class CzechAnalyzer

public final class CzechAnalyzer extends Analyzer

Analyzer for Czech language. Supports an external list of stopwords (words that will not be indexed at all). A default set of stopwords is used unless an alternative list is specified, the exclusion list is empty by default.

Author: Lukas Zapletal [lzap@root.cz]

Field Summary
static String[]CZECH_STOP_WORDS
List of typical stopwords.
Constructor Summary
CzechAnalyzer()
Builds an analyzer with the default stop words ({@link #CZECH_STOP_WORDS}).
CzechAnalyzer(String[] stopwords)
Builds an analyzer with the given stop words.
CzechAnalyzer(Hashtable stopwords)
Builds an analyzer with the given stop words.
CzechAnalyzer(HashSet stopwords)
CzechAnalyzer(File stopwords)
Builds an analyzer with the given stop words.
Method Summary
voidloadStopWords(InputStream wordfile, String encoding)
Loads stopwords hash from resource stream (file, database...).
TokenStreamtokenStream(String fieldName, Reader reader)
Creates a TokenStream which tokenizes all the text in the provided Reader.

Field Detail

CZECH_STOP_WORDS

public static final String[] CZECH_STOP_WORDS
List of typical stopwords.

Constructor Detail

CzechAnalyzer

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

CzechAnalyzer

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

CzechAnalyzer

public CzechAnalyzer(Hashtable stopwords)

Deprecated:

Builds an analyzer with the given stop words.

CzechAnalyzer

public CzechAnalyzer(HashSet stopwords)

CzechAnalyzer

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

Method Detail

loadStopWords

public void loadStopWords(InputStream wordfile, String encoding)
Loads stopwords hash from resource stream (file, database...).

Parameters: wordfile File containing the wordlist encoding Encoding used (win-1250, iso-8859-2, ...), null for default system encoding

tokenStream

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

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

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