org.apache.lucene.analysis.br
Class BrazilianAnalyzer

java.lang.Object
  extended by org.apache.lucene.analysis.Analyzer
      extended by org.apache.lucene.analysis.br.BrazilianAnalyzer

public final class BrazilianAnalyzer
extends org.apache.lucene.analysis.Analyzer

Analyzer for Brazilian Portuguese language.

Supports an external list of stopwords (words that will not be indexed at all) and an external list of exclusions (words that will not be stemmed, but indexed).

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


Field Summary
static String[] BRAZILIAN_STOP_WORDS
          List of typical Brazilian Portuguese stopwords.
 
Fields inherited from class org.apache.lucene.analysis.Analyzer
overridesTokenStreamMethod
 
Constructor Summary
BrazilianAnalyzer()
          Deprecated. Use BrazilianAnalyzer(Version) instead
BrazilianAnalyzer(File stopwords)
          Deprecated. Use BrazilianAnalyzer(Version, File) instead
BrazilianAnalyzer(Map stopwords)
          Deprecated. Use BrazilianAnalyzer(Version, Map) instead
BrazilianAnalyzer(String[] stopwords)
          Deprecated. Use BrazilianAnalyzer(Version, String[]) instead
BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion)
          Builds an analyzer with the default stop words (BRAZILIAN_STOP_WORDS).
BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion, File stopwords)
          Builds an analyzer with the given stop words.
BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion, Map stopwords)
          Builds an analyzer with the given stop words.
BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion, String[] stopwords)
          Builds an analyzer with the given stop words.
 
Method Summary
 org.apache.lucene.analysis.TokenStream reusableTokenStream(String fieldName, Reader reader)
          Returns a (possibly reused) TokenStream which tokenizes all the text in the provided Reader.
 void setStemExclusionTable(File exclusionlist)
          Builds an exclusionlist from the words contained in the given file.
 void setStemExclusionTable(Map exclusionlist)
          Builds an exclusionlist from a Map.
 void setStemExclusionTable(String[] exclusionlist)
          Builds an exclusionlist from an array of Strings.
 org.apache.lucene.analysis.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

BRAZILIAN_STOP_WORDS

public static final String[] BRAZILIAN_STOP_WORDS
List of typical Brazilian Portuguese stopwords.

Constructor Detail

BrazilianAnalyzer

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

Builds an analyzer with the default stop words (BRAZILIAN_STOP_WORDS).


BrazilianAnalyzer

public BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion)
Builds an analyzer with the default stop words (BRAZILIAN_STOP_WORDS).


BrazilianAnalyzer

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

Builds an analyzer with the given stop words.


BrazilianAnalyzer

public BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion,
                         String[] stopwords)
Builds an analyzer with the given stop words.


BrazilianAnalyzer

public BrazilianAnalyzer(Map stopwords)
Deprecated. Use BrazilianAnalyzer(Version, Map) instead

Builds an analyzer with the given stop words.


BrazilianAnalyzer

public BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion,
                         Map stopwords)
Builds an analyzer with the given stop words.


BrazilianAnalyzer

public BrazilianAnalyzer(File stopwords)
                  throws IOException
Deprecated. Use BrazilianAnalyzer(Version, File) instead

Builds an analyzer with the given stop words.

Throws:
IOException

BrazilianAnalyzer

public BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion,
                         File stopwords)
                  throws IOException
Builds an analyzer with the given stop words.

Throws:
IOException
Method Detail

setStemExclusionTable

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


setStemExclusionTable

public void setStemExclusionTable(Map exclusionlist)
Builds an exclusionlist from a Map.


setStemExclusionTable

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

Throws:
IOException

tokenStream

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

Specified by:
tokenStream in class org.apache.lucene.analysis.Analyzer
Returns:
A TokenStream built from a StandardTokenizer filtered with LowerCaseFilter, StandardFilter, StopFilter, and BrazilianStemFilter.

reusableTokenStream

public org.apache.lucene.analysis.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 org.apache.lucene.analysis.Analyzer
Returns:
A TokenStream built from a StandardTokenizer filtered with LowerCaseFilter, StandardFilter, StopFilter, and BrazilianStemFilter.
Throws:
IOException


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