org.apache.lucene.analysis.br
Class BrazilianAnalyzer

java.lang.Object
  extended by org.apache.lucene.analysis.Analyzer
      extended by org.apache.lucene.analysis.ReusableAnalyzerBase
          extended by org.apache.lucene.analysis.StopwordAnalyzerBase
              extended by org.apache.lucene.analysis.br.BrazilianAnalyzer
All Implemented Interfaces:
Closeable

public final class BrazilianAnalyzer
extends StopwordAnalyzerBase

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.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.analysis.ReusableAnalyzerBase
ReusableAnalyzerBase.TokenStreamComponents
 
Field Summary
static String[] BRAZILIAN_STOP_WORDS
          Deprecated. use getDefaultStopSet() instead
static String DEFAULT_STOPWORD_FILE
          File containing default Brazilian Portuguese stopwords.
 
Fields inherited from class org.apache.lucene.analysis.StopwordAnalyzerBase
matchVersion, stopwords
 
Constructor Summary
BrazilianAnalyzer(Version matchVersion)
          Builds an analyzer with the default stop words (getDefaultStopSet()).
BrazilianAnalyzer(Version matchVersion, File stopwords)
          Deprecated. use BrazilianAnalyzer(Version, Set) instead
BrazilianAnalyzer(Version matchVersion, Map<?,?> stopwords)
          Deprecated. use BrazilianAnalyzer(Version, Set) instead
BrazilianAnalyzer(Version matchVersion, Set<?> stopwords)
          Builds an analyzer with the given stop words
BrazilianAnalyzer(Version matchVersion, Set<?> stopwords, Set<?> stemExclusionSet)
          Builds an analyzer with the given stop words and stemming exclusion words
BrazilianAnalyzer(Version matchVersion, String... stopwords)
          Deprecated. use BrazilianAnalyzer(Version, Set) instead
 
Method Summary
protected  ReusableAnalyzerBase.TokenStreamComponents createComponents(String fieldName, Reader reader)
          Creates ReusableAnalyzerBase.TokenStreamComponents used to tokenize all the text in the provided Reader.
static Set<?> getDefaultStopSet()
          Returns an unmodifiable instance of the default stop-words set.
 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
 
Methods inherited from class org.apache.lucene.analysis.StopwordAnalyzerBase
getStopwordSet, loadStopwordSet, loadStopwordSet, loadStopwordSet
 
Methods inherited from class org.apache.lucene.analysis.ReusableAnalyzerBase
initReader, reusableTokenStream, tokenStream
 
Methods inherited from class org.apache.lucene.analysis.Analyzer
close, getOffsetGap, getPositionIncrementGap, getPreviousTokenStream, setPreviousTokenStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BRAZILIAN_STOP_WORDS

@Deprecated
public static final String[] BRAZILIAN_STOP_WORDS
Deprecated. use getDefaultStopSet() instead
List of typical Brazilian Portuguese stopwords.


DEFAULT_STOPWORD_FILE

public static final String DEFAULT_STOPWORD_FILE
File containing default Brazilian Portuguese stopwords.

See Also:
Constant Field Values
Constructor Detail

BrazilianAnalyzer

public BrazilianAnalyzer(Version matchVersion)
Builds an analyzer with the default stop words (getDefaultStopSet()).


BrazilianAnalyzer

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

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

BrazilianAnalyzer

public BrazilianAnalyzer(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

@Deprecated
public BrazilianAnalyzer(Version matchVersion,
                                    String... stopwords)
Deprecated. use BrazilianAnalyzer(Version, Set) instead

Builds an analyzer with the given stop words.


BrazilianAnalyzer

@Deprecated
public BrazilianAnalyzer(Version matchVersion,
                                    Map<?,?> stopwords)
Deprecated. use BrazilianAnalyzer(Version, Set) instead

Builds an analyzer with the given stop words.


BrazilianAnalyzer

@Deprecated
public BrazilianAnalyzer(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

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

Builds an exclusionlist from an array of Strings.


setStemExclusionTable

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

Builds an exclusionlist from a Map.


setStemExclusionTable

@Deprecated
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

createComponents

protected ReusableAnalyzerBase.TokenStreamComponents createComponents(String fieldName,
                                                                      Reader reader)
Creates ReusableAnalyzerBase.TokenStreamComponents used to tokenize all the text in the provided Reader.

Specified by:
createComponents in class ReusableAnalyzerBase
Parameters:
fieldName - the name of the fields content passed to the ReusableAnalyzerBase.TokenStreamComponents sink as a reader
reader - the reader passed to the Tokenizer constructor
Returns:
ReusableAnalyzerBase.TokenStreamComponents built from a StandardTokenizer filtered with LowerCaseFilter, StandardFilter, StopFilter , and BrazilianStemFilter.