hunspell

0.2.0 released

crystal-hunspell

Build Status GitHub release License

Crystal bindings for Hunspell.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      crystal-hunspell:
        github: mamantoha/crystal-hunspell
    
  2. Run shards install

Usage

Open a dictionary:

require "hunspell"

# instantiate Hunspell with English affix and dictionary files
hunspell = Hunspell.new("/usr/share/hunspell/en_US.aff", "/usr/share/hunspell/en_US.dic")

Check if a word is valid:

hunspell.spellcheck("crystal")
# => true

hunspell.spellcheck("cristal")
# => false

Find the stems of a word:

hunsell.stem("fishing")
# => ["fishing", "fish"]

Suggest alternate spellings for a word:

hunspell.suggest("arbitrage")	hunspell.suggest("crystal")
# => ["arbitrage", "arbitrages", "arbitrager", "arbitraged", "arbitrate"]

Contributing

  1. Fork it (https://github.com/mamantoha/crystal-hunspell/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

hunspell:
  github: mamantoha/crystal-hunspell
  version: ~> 0.2.0
License MIT
Crystal 0.27.2

Authors

Dependencies 0

Development Dependencies 0

Dependents 0

Last synced .
search fire star recently