FileDocCategorySizeDatePackage
BrazilianAnalyzer.javaAPI DocApache Lucene 1.94773Mon Feb 20 09:18:50 GMT 2006org.apache.lucene.analysis.br

BrazilianAnalyzer

public final class BrazilianAnalyzer extends Analyzer
Analyzer for Brazilian language. Supports an external list of stopwords (words that will not be indexed at all) and an external list of exclusions (word that will not be stemmed, but indexed).
author
João Kramer

Fields Summary
public static final String[]
BRAZILIAN_STOP_WORDS
List of typical Brazilian stopwords.
private Set
stoptable
Contains the stopwords used with the StopFilter.
private Set
excltable
Contains words that should be indexed but not stemmed.
Constructors Summary
public BrazilianAnalyzer()
Builds an analyzer with the default stop words ({@link #BRAZILIAN_STOP_WORDS}).


	          	 
	  
		stoptable = StopFilter.makeStopSet( BRAZILIAN_STOP_WORDS );
	
public BrazilianAnalyzer(String[] stopwords)
Builds an analyzer with the given stop words.

		stoptable = StopFilter.makeStopSet( stopwords );
	
public BrazilianAnalyzer(Hashtable stopwords)
Builds an analyzer with the given stop words.

		stoptable = new HashSet(stopwords.keySet());
	
public BrazilianAnalyzer(File stopwords)
Builds an analyzer with the given stop words.

		stoptable = WordlistLoader.getWordSet( stopwords );
	
Methods Summary
public voidsetStemExclusionTable(java.lang.String[] exclusionlist)
Builds an exclusionlist from an array of Strings.

		excltable = StopFilter.makeStopSet( exclusionlist );
	
public voidsetStemExclusionTable(java.util.Hashtable exclusionlist)
Builds an exclusionlist from a Hashtable.

		excltable = new HashSet(exclusionlist.keySet());
	
public voidsetStemExclusionTable(java.io.File exclusionlist)
Builds an exclusionlist from the words contained in the given file.

		excltable = WordlistLoader.getWordSet( exclusionlist );
	
public final org.apache.lucene.analysis.TokenStreamtokenStream(java.lang.String fieldName, java.io.Reader reader)
Creates a TokenStream which tokenizes all the text in the provided Reader.

return
A TokenStream build from a StandardTokenizer filtered with StandardFilter, StopFilter, GermanStemFilter and LowerCaseFilter.

		TokenStream result = new StandardTokenizer( reader );
		result = new StandardFilter( result );
		result = new StopFilter( result, stoptable );
		result = new BrazilianStemFilter( result, excltable );
		// Convert to lowercase after stemming!
		result = new LowerCaseFilter( result );
		return result;