There are several Hunspell bindings for Ruby:
- http://rubyforge.org/projects/hunspell/
- http://rubyforge.org/projects/ruby-hunspell/
Initially, I use Hunspell gem but after digging in to source code, I found a memory lick problem: the author forgot to free suggestion list after call Hunspell_suggest(pHunspell, &slst, str) function.
I decided to write my own binding with less code using RubyInline. Here is the result:
A simplest Hunspell Ruby Binding within 60 line of codes :)
Check it out at:
http://github.com/tiendung/rhunspell/
Update: Now the binding become a Rubygem, you can install it easily with following command:
"sudo gem install rhunspell"
No comments:
Post a Comment