Popularity
1.3
Growing
Activity
0.1
-
2
1
0

Programming language: Crystal
Tags: C Bindings    
Latest version: v0.3.0

crystal-hunspell alternatives and similar shards

Based on the "C bindings" category

Do you think we are missing an alternative of crystal-hunspell or a related project?

Add another 'C bindings' Shard

README

crystal-hunspell

Build Status GitHub release License

Crystal bindings for Hunspell.

Installation

Before installing crystal-hunspell ensure you have hunspell already installed:

  1. Add the dependency to your shard.yml:
   dependencies:
     hunspell:
       github: mamantoha/crystal-hunspell
  1. Run shards install

Usage

require "hunspell"

Open a dictionary:

hunspell = Hunspell.new("/usr/share/hunspell/en_US.aff", "/usr/share/hunspell/en_US.dic")

or

hunspell = Hunspell.new("en_US")

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")
# => ["arbitrage", "arbitrages", "arbitrager", "arbitraged", "arbitrate"]

Development

Generate bindings for Hunspell

crystal ./lib/crystal_lib/src/main.cr -- src/hunspell/lib_hunspell.cr.in

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


*Note that all licence references and agreements mentioned in the crystal-hunspell README section above are relevant to that project's source code only.