hunspell
Version, currently 0.1.12 versions
- 0.1.1latestFeb 12, 2021
- 0.1.0not indexedMar 23, 2021
github.com/postmodern/hunspell.cr
Crystal bindings for libhunspell. Crystal port of the Ruby ffi-hunspell gem.
4 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
hunspell:
github: postmodern/hunspell.cr
version: ~> 0.1.1Then run:
shards installshard.yml
- Crystal
0.35.1- License
- MIT
- Author
- Postmodern
Dependencies
Development Dependencies
- spectator>= 0.9.9 and < 1.0.0gitlab: arctic-fox/spectator, branch: contain_elements_matcherdev
README
hunspell.cr
- Source
- Issues
- Documentation
- [Email](postmodern.mod3 at gmail.com)
Crystal bindings for Hunspell. Crystal port of the Ruby ffi-hunspell gem and should be API compatible.
Installation
-
Install
libhunspell-
Debian / Ubuntu:
$ sudo apt install libhunspell-dev hunspell-en-us -
RedHat / Fedora:
$ sudo dnf install hunspell-devel hunspell-en -
macOS:
$ brew install hunspell
-
-
Add the dependency to your
shard.yml:dependencies: hunspell: github: your-github-user/hunspell.cr -
Run
shards install
Examples
Open a dictionary:
require "hunspell"
Hunspell.dict do |dict|
# ...
end
Hunspell.dict("en_GB") do |dict|
# ...
end
dict = 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"]
Development
After installing libhunspell (see Installation):
$ shards install
$ crystal spec
Contributing
- Fork it (https://github.com/postmodern/hunspell.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Postmodern - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.1- Tagged
- Feb 12, 2021
- Commit
fbe9d74479e3- Crystal
0.35.1- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/postmodern/hunspell.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 2