Hi,
I m trying to set French stop Words.
So i created a file called “FrenchStemmingAnalyzer.rb” and i put it in
/lib of my rails App.
class FrenchStemmingAnalyzer < Ferret::Analysis::Analyzer
include Ferret::Analysis
def initialize(stop_words = FULL_FRENCH_STOP_WORDS)
@stop_words = stop_words
end
def token_stream(field, str)
StemFilter.new(StopFilter.new(LowerCaseFilter.new(StandardTokenizer.new(str)),
@stop_words), ‘fr’)
end
end
Then i configured my Acts_as_ferret like that :
acts_as_ferret( { :fields => {
:video_id=> {},
:nom => {:boost => 200},
}, :remote => true, :ferret => {:analyzer =>
Ferret::Analysis::FrenchStemmingAnalyzer.new([])}})
But i ve got an error which say :
(Original exception: uninitialized constant
Ferret::Analysis::FrenchStemmingAnalyzer [NameError])
I don t know what went wrong…
is my custom analyzer synthax wrong ?
of do i have to put it somewhere else that in /lib of my Rails
application
Thanks for helping me with that,
Guillaume.