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
All Implemented Interfaces:
Closeable

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
          Deprecated. use getDefaultStopSet() instead
 
Fields inherited from class org.apache.lucene.analysis.Analyzer
overridesTokenStreamMethod
 
Constructor Summary
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)
          Deprecated. use BrazilianAnalyzer(Version, Set) instead
BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion, Map<?,?> stopwords)
          Deprecated. use BrazilianAnalyzer(Version, Set) instead
BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion, Set<?> stopwords)
          Builds an analyzer with the given stop words
BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion, Set<?> stopwords, Set<?> stemExclusionSet)
          Builds an analyzer with the given stop words and stemming exclusion words
BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion, String... stopwords)
          Deprecated. use BrazilianAnalyzer(Version, Set) instead
 
Method Summary
static Set<?> getDefaultStopSet()
          Returns an unmodifiable instance of the default stop-words set.
 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)
          Deprecated. use BrazilianAnalyzer(Version, Set, Set) instead
 void setStemExclusionTable(Map<?,?> exclusionlist)
          Deprecated. use BrazilianAnalyzer(Version, Set, Set) instead
 void setStemExclusionTable(String... exclusionlist)
          Deprecated. use BrazilianAnalyzer(Version, Set, Set) instead
 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
Deprecated. use getDefaultStopSet() instead
List of typical Brazilian Portuguese stopwords.

Constructor Detail

BrazilianAnalyzer

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


BrazilianAnalyzer

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

Parameters:
matchVersion - lucene compatibility version
stopwords - a stopword set

BrazilianAnalyzer

public BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion,
                         Set<?> stopwords,
                         Set<?> stemExclusionSet)
Builds an analyzer with the given stop words and stemming exclusion words

Parameters:
matchVersion - lucene compatibility version
stopwords - a stopword set

BrazilianAnalyzer

public BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion,
                         String... stopwords)
Deprecated. use BrazilianAnalyzer(Version, Set) instead

Builds an analyzer with the given stop words.


BrazilianAnalyzer

public BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion,
                         Map<?,?> stopwords)
Deprecated. use BrazilianAnalyzer(Version, Set) instead

Builds an analyzer with the given stop words.


BrazilianAnalyzer

public BrazilianAnalyzer(org.apache.lucene.util.Version matchVersion,
                         File stopwords)
                  throws IOException
Deprecated. use BrazilianAnalyzer(Version, Set) instead

Builds an analyzer with the given stop words.

Throws:
IOException
Method Detail

getDefaultStopSet

public static Set<?> getDefaultStopSet()
Returns an unmodifiable instance of the default stop-words set.

Returns:
an unmodifiable instance of the default stop-words set.

setStemExclusionTable

public void setStemExclusionTable(String... exclusionlist)
Deprecated. use BrazilianAnalyzer(Version, Set, Set) instead

Builds an exclusionlist from an array of Strings.


setStemExclusionTable

public void setStemExclusionTable(Map<?,?> exclusionlist)
Deprecated. use BrazilianAnalyzer(Version, Set, Set) instead

Builds an exclusionlist from a Map.


setStemExclusionTable

public void setStemExclusionTable(File exclusionlist)
                           throws IOException
Deprecated. use BrazilianAnalyzer(Version, Set, Set) instead

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.