Skip to content

postmodern/ffi-hunspell

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

About

Ruby FFI bindings for Hunspell.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages