Re: AAF - Stem Analyzer

I’m not on AAF. Can someone else help Raymond with an example?

On Wed, Dec 06, 2006 at 01:46:38PM -0800, Matt S. wrote:

Schnitz

Do you have an example of how to do this? I’m using AAF.

just specify your analyzer with the :analyzer option, i.e.

acts_as_ferret :analyzer => GermanStemmingAnalyzer.new

Here’s what my GermanStemmingAnalyzer looks like:

class GermanStemmingAnalyzer < Ferret::Analysis::Analyzer
include Ferret::Analysis
def initialize(stop_words = FULL_GERMAN_STOP_WORDS)
@stop_words = stop_words
end
def token_stream(field, str)
StemFilter.new(StopFilter.new(LowerCaseFilter.new(StandardTokenizer.new(str)),
@stop_words), ‘de’)
end
end

Jens


webit! Gesellschaft für neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer [email protected]
Schnorrstraße 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66