class XapianFu::StemFactory

Public Class Methods

stemmer_for(stemmer) click to toggle source

Return a Xapian::Stem object for the given option. Accepts any string that the Xapian::Stem class accepts (Either the English name for the language or the two letter ISO639 code).

If given false or nil, will return a “none” stemmer.

It will also accept and return an existing Xapian::Stem object.

    # File lib/xapian_fu/xapian_doc.rb
353 def self.stemmer_for(stemmer)
354   if stemmer.is_a? Xapian::Stem
355     stemmer
356   elsif stemmer.is_a?(String) or stemmer.is_a?(Symbol)
357     Xapian::Stem.new(stemmer.to_s)
358   else
359     Xapian::Stem.new("none")
360   end
361 end