- Source
- Issues
- Documentation
- [Email](postmodern.mod3 at gmail.com)
Ruby FFI bindings for Hunspell.
Open a dictionary:
require 'ffi/hunspell'
FFI::Hunspell.dict do |dict|
# ...
end
FFI::Hunspell.dict('en_GB') do |dict|
# ...
end
dict = FFI::Hunspell.dict('en_GB')
# ...
dict.close
Check if a word is valid:
dict.check?('dog')
# => true
dict.check?('d0g')
# => false
Find the stems of a word:
dict.stem('dogs')
# => ["dog"]
Suggest alternate spellings for a word:
dict.suggest('arbitrage')
# => ["arbitrage", "arbitrages", "arbitrager", "arbitraged", "arbitrate"]
- libhunspell >= 1.2.0
- ffi >= 0.6.0, <= 1.1.0
- env ~> 0.1.2
$ sudo gem install ffi-hunspell
Some Linux distributions do not install the libhunspell-1.2.so
shared library file, but instead installs libhunspell-1.2.so.0
.
Simply create a symbolic link to the hunspell shared library,
so that {FFI::Hunspell} can find the library:
# ln -s /usr/lib/libhunspell-1.2.so.0 /usr/lib/libhunspell-1.2.so
Copyright (c) 2010-2011 Hal Brodigan
See {file:LICENSE.txt} for license information.