Class: XapianFu::StemFactory
Class Method Summary collapse
-
.stemmer_for(stemmer) ⇒ Object
Return a Xapian::Stem object for the given option.
Class Method Details
.stemmer_for(stemmer) ⇒ Object
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.
353 354 355 356 357 358 359 360 361 |
# File 'lib/xapian_fu/xapian_doc.rb', line 353 def self.stemmer_for(stemmer) if stemmer.is_a? Xapian::Stem stemmer elsif stemmer.is_a?(String) or stemmer.is_a?(Symbol) Xapian::Stem.new(stemmer.to_s) else Xapian::Stem.new("none") end end |