No commit activity in last 3 years
No release in over 3 years
Stemmer implementation to ruby using libstemmer_c. Working with ruby 1.9.1
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Ruby-Stemmer¶ ↑

Ruby-Stemmer exposes SnowBall API to Ruby.

This package includes libstemmer_c library released under BSD licence and available for free at: snowball.tartarus.org/dist/libstemmer_c.tgz.

For more details about libstemmer_c please visit snowball.tartarus.org.

Usage¶ ↑

require 'rubygems'
require 'lingua/stemmer'

stemmer= Lingua::Stemmer.new(:language => "ro")
stemmer.stem("netăgăduit") #=> netăgădu

Alternative¶ ↑

require 'rubygems'
require 'lingua/stemmer'

Lingua.stemmer( %w(incontestabil neîndoielnic), :language => "ro" ) #=> ["incontest", "neîndoieln"]
Lingua.stemmer("installation") #=> "instal"
Lingua.stemmer("installation", :language => "fr", :encoding => "ISO_8859_1") do | word |
  puts "~> #{word}" #=> "instal"
end # => #<Lingua::Stemmer:0x102501e48>

Rails¶ ↑

# in config/environment.rb:
config.gem 'ruby-stemmer', :version => '>=0.6.2', :lib => 'lingua/stemmer'

More details ¶ ↑

Install¶ ↑

Standard install with:¶ ↑

gem install ruby-stemmer

Please not that Windows is not supported at this time.

Development version¶ ↑

$ git clone git://github.com/aurelian/ruby-stemmer.git
$ cd ruby-stemmer
$ rake -T #<== see what we've got
$ rake ext #<== builds the extension do'h
$ rake test

NOT A BUG¶ ↑

The stemming process is an algorithm to allow one to find the stem of an word (not the root of it). For further reference on stem vs. root, please check wikipedia articles on the topic:

TODO¶ ↑

Note on Patches/Pull Requests¶ ↑

  • Fork the project from github: github.com/aurelian/ruby-stemmer

  • Make your feature addition or bug fix: github.com/aurelian/ruby-stemmer/issues

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history.

    if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull

  • Send me a pull request. Bonus points for topic branches.

Alternative Stemmers for Ruby¶ ↑

Copyright © 2009 Aurelian Oancea. See MIT-LICENSE for details.

Contributors¶ ↑

  • Aurelian Oancea

  • Yury Korolev

Real life usage¶ ↑