org.apache.lucene.analysis.cz
Class CzechAnalyzer

java.lang.Object
  extended by org.apache.lucene.analysis.Analyzer
      extended by org.apache.lucene.analysis.cz.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.


Field Summary
static String[] CZECH_STOP_WORDS
          List of typical stopwords.
 
Fields inherited from class org.apache.lucene.analysis.Analyzer
overridesTokenStreamMethod
 
Constructor Summary
CzechAnalyzer()
          Builds an analyzer with the default stop words (CZECH_STOP_WORDS).
CzechAnalyzer(File stopwords)
          Builds an analyzer with the given stop words.
CzechAnalyzer(HashSet stopwords)
           
CzechAnalyzer(String[] stopwords)
          Builds an analyzer with the given stop words.
 
Method Summary
 void loadStopWords(InputStream wordfile, String encoding)
          Loads stopwords hash from resource stream (file, database...).
 TokenStream reusableTokenStream(String fieldName, Reader reader)
          Returns a (possibly reused) TokenStream which tokenizes all the text in the provided Reader.
 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

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 (CZECH_STOP_WORDS).


CzechAnalyzer

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


CzechAnalyzer

public CzechAnalyzer(HashSet stopwords)

CzechAnalyzer

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

Throws:
IOException
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.

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

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


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