Portuguese Stemming

Today while compiling ferret I noticed there was a Portuguese stemmer
being compiled. How do I enable it’s use for my index?

Pedro.

Hi Pedro,

You need to build a custom analyzer. Maybe something like this;

class PortugueseAnalyzer
    def token_stream(field, string)
        StemFilter.new(StopFilter.new(StandardTokenizer.new(string),
                                      FULL_PORTUGUESE_STOP_WORDS),
                       "pt", "UTF_8")
    end
end

index = Index.new(:analyzer => PortugueseAnalyzer.new)

I hope the formatting works in your email reader.

Cheers,
Dave