org.apache.lucene.analysis.snowball
Class SnowballAnalyzer

java.lang.Object
  extended by org.apache.lucene.analysis.Analyzer
      extended by org.apache.lucene.analysis.snowball.SnowballAnalyzer
All Implemented Interfaces:
Closeable

public class SnowballAnalyzer
extends org.apache.lucene.analysis.Analyzer

Filters StandardTokenizer with StandardFilter, LowerCaseFilter, StopFilter and SnowballFilter. Available stemmers are listed in org.tartarus.snowball.ext. The name of a stemmer is the part of the class name before "Stemmer", e.g., the stemmer in EnglishStemmer is named "English".

NOTE: This class uses the same Version dependent settings as StandardAnalyzer.


Field Summary
 
Fields inherited from class org.apache.lucene.analysis.Analyzer
overridesTokenStreamMethod
 
Constructor Summary
SnowballAnalyzer(org.apache.lucene.util.Version matchVersion, String name)
          Builds the named analyzer with no stop words.
SnowballAnalyzer(org.apache.lucene.util.Version matchVersion, String name, Set<?> stopWords)
          Builds the named analyzer with the given stop words.
SnowballAnalyzer(org.apache.lucene.util.Version matchVersion, String name, String[] stopWords)
          Deprecated. Use SnowballAnalyzer(Version, String, Set) instead.
 
Method Summary
 org.apache.lucene.analysis.TokenStream reusableTokenStream(String fieldName, Reader reader)
          Returns a (possibly reused) StandardTokenizer filtered by a StandardFilter, a LowerCaseFilter, a StopFilter, and a SnowballFilter
 org.apache.lucene.analysis.TokenStream tokenStream(String fieldName, Reader reader)
          Constructs a StandardTokenizer filtered by a StandardFilter, a LowerCaseFilter, a StopFilter, and a SnowballFilter
 
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
 

Constructor Detail

SnowballAnalyzer

public SnowballAnalyzer(org.apache.lucene.util.Version matchVersion,
                        String name)
Builds the named analyzer with no stop words.


SnowballAnalyzer

public SnowballAnalyzer(org.apache.lucene.util.Version matchVersion,
                        String name,
                        String[] stopWords)
Deprecated. Use SnowballAnalyzer(Version, String, Set) instead.

Builds the named analyzer with the given stop words.


SnowballAnalyzer

public SnowballAnalyzer(org.apache.lucene.util.Version matchVersion,
                        String name,
                        Set<?> stopWords)
Builds the named analyzer with the given stop words.

Method Detail

tokenStream

public org.apache.lucene.analysis.TokenStream tokenStream(String fieldName,
                                                          Reader reader)
Constructs a StandardTokenizer filtered by a StandardFilter, a LowerCaseFilter, a StopFilter, and a SnowballFilter

Specified by:
tokenStream in class org.apache.lucene.analysis.Analyzer

reusableTokenStream

public org.apache.lucene.analysis.TokenStream reusableTokenStream(String fieldName,
                                                                  Reader reader)
                                                           throws IOException
Returns a (possibly reused) StandardTokenizer filtered by a StandardFilter, a LowerCaseFilter, a StopFilter, and a SnowballFilter

Overrides:
reusableTokenStream in class org.apache.lucene.analysis.Analyzer
Throws:
IOException


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