On Wed, Dec 06, 2006 at 01:46:38PM -0800, Matt Schnitz wrote:
> I'm not on AAF.  Can someone else help Raymond with an example?
> 
> On 12/6/06, Raymond O'connor <[EMAIL PROTECTED]> wrote:
> >
> >Matt Schnitz wrote:
> >> You also need to stem-analyze the incoming query.
> >>
> >> I had this same problem. :^>
> >>
> >>
> >> 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
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to