No release in over 3 years
Low commit activity in last 3 years
There's a lot of open issues
Ruby FFI bindings for the Hunspell spell checker.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.0
~> 0.7

Runtime

~> 1.0
 Project Readme

ffi-hunspell

CI Code Climate

Description

Ruby FFI bindings for Hunspell.

Examples

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"]

Requirements

Install

$ gem install ffi-hunspell

libhunspell

  • Debian / Ubuntu:

    $ sudo apt install libhunspell-dev hunspell-en-us
    
  • RedHat / Fedora:

    $ sudo dnf install hunspell-devel hunspell-en
    
  • macOS:

    $ brew install hunspell
    

License

Copyright (c) 2010-2021 Hal Brodigan

See {file:LICENSE.txt} for license information.