{"id":13482393,"url":"https://github.com/mamantoha/crystal-hunspell","last_synced_at":"2026-01-21T08:12:43.244Z","repository":{"id":53723475,"uuid":"179836617","full_name":"mamantoha/crystal-hunspell","owner":"mamantoha","description":"Crystal bindings for Hunspell.","archived":false,"fork":false,"pushed_at":"2024-05-15T10:29:02.000Z","size":40,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T19:25:05.613Z","etag":null,"topics":["bindings","crystal","hacktoberfest","hunspell","wrapper"],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mamantoha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-06T13:26:54.000Z","updated_at":"2024-10-31T01:24:59.000Z","dependencies_parsed_at":"2024-05-02T19:02:15.898Z","dependency_job_id":"beda09bf-ae72-41a2-a142-536a5f5c87c3","html_url":"https://github.com/mamantoha/crystal-hunspell","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/mamantoha/crystal-hunspell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fcrystal-hunspell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fcrystal-hunspell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fcrystal-hunspell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fcrystal-hunspell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mamantoha","download_url":"https://codeload.github.com/mamantoha/crystal-hunspell/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mamantoha%2Fcrystal-hunspell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28629924,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bindings","crystal","hacktoberfest","hunspell","wrapper"],"created_at":"2024-07-31T17:01:01.539Z","updated_at":"2026-01-21T08:12:43.225Z","avatar_url":"https://github.com/mamantoha.png","language":"Crystal","funding_links":[],"categories":["C bindings"],"sub_categories":[],"readme":"# crystal-hunspell\n\n[![CI](https://github.com/mamantoha/crystal-hunspell/actions/workflows/ci.yml/badge.svg)](https://github.com/mamantoha/crystal-hunspell/actions/workflows/ci.yml)\n[![GitHub release](https://img.shields.io/github/release/mamantoha/crystal-hunspell.svg)](https://github.com/mamantoha/crystal-hunspell/releases)\n[![License](https://img.shields.io/github/license/mamantoha/crystal-hunspell.svg)](https://github.com/mamantoha/crystal-hunspell/blob/master/LICENSE)\n\nCrystal bindings for Hunspell.\n\n## Installation\n\nBefore installing `crystal-hunspell` ensure you have [hunspell](https://github.com/hunspell/hunspell) already installed:\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     hunspell:\n       github: mamantoha/crystal-hunspell\n   ```\n\n2. Run `shards install`\n\n## Usage\n\nThe library has been tested with Hunspell version 1.7.2.\n\n```crystal\nrequire \"hunspell\"\n```\n\nOpen a dictionary:\n\n```crystal\nhunspell = Hunspell.new(\"/usr/share/hunspell/en_US.aff\", \"/usr/share/hunspell/en_US.dic\")\n```\n\nor\n\n```crystal\nhunspell = Hunspell.new(\"en_US\")\n```\n\nEnsure to close `Hunspell` instance after using.\n\n```crystal\nhunspell.close\n```\n\nBelow are some simple examples for how to use the repository.\n\n### Spelling\n\nIt's a simple task to ask if a particular word is in the dictionary.\n\n```crystal\nhunspell.spell?(\"correct\")\n# =\u003e true\n\nhunspell.spell?(\"incorect\")\n# =\u003e false\n```\n\nThis will only ever return `true` or `false`, and won't give suggestions about why it might be wrong. It also depends on your choice of dictionary.\n\n### Suggestions\n\nIf you want to get a suggestion from Hunspell, it can provide a corrected label given a basestring input.\n\n```crystal\nhunspell.suggest(\"arbitrage\")\n# =\u003e [\"arbitrage\", \"arbitrages\", \"arbitrager\", \"arbitraged\", \"arbitrate\"]\n```\n\n### Suffix Match\n\n```crystal\nhunspell.suffix_suggest(\"do\")\n# =\u003e [\"doing\", \"doth\", \"doer\", \"dos\", \"do's\", \"doings\", \"doers\"]\n```\n\n### Stemming\n\nThe module can also stem words, providing the stems for pluralization and other inflections.\n\n```crystal\nhunsell.stem(\"fishing\")\n# =\u003e [\"fishing\", \"fish\"]\n```\n\n### Analyze\n\nLike stemming but return morphological analysis of the input instead.\n\n```crystal\nhunspell.analyze(\"permanently\")\n# =\u003e [\" st:permanent fl:Y\"]\n```\n\n### Bulk Requests\n\nYou can also request bulk actions against Hunspell. Currently `suggest`, `suffix_suggest`, `stem`, and `analyze` are bulk requestable.\n\n```crystal\nhunspell.bulk_suggest([\"correct\", \"incorect\"])\n# =\u003e {\"correct\"  =\u003e [\"correct\", \"corrects\", \"cor rect\", \"cor-rect\"],\n#     \"incorect\" =\u003e [\"incorrect\", \"correction\", \"corrector\", \"injector\", \"correct\"]}\n\nhunspell.bulk_suffix_suggest([\"cat\", \"do\"])\n# =\u003e {\"cat\" =\u003e [\"cats\", \"cat's\"],\n#     \"do\"  =\u003e [\"doing\", \"doth\", \"doer\", \"dos\", \"do's\", \"doings\", \"doers\"]}\n\nhunspell.bulk_stem([\"stems\", \"currencies\"])\n# =\u003e {\"stems\" =\u003e [\"stem\"], \"currencies\" =\u003e [\"currency\"]}\n\nhunspell.bulk_analyze([\"dog\", \"permanently\"])\n# =\u003e {\"dog\" =\u003e [\" st:dog\"], \"permanently\" =\u003e [\" st:permanent fl:Y\"]}\n```\n\n## Development\n\n```\nsudo apt install libclang-dev libhunspell-dev\n```\n\nGenerate new bindings for Hunspell\n\n```console\ncrystal ./lib/crystal_lib/src/main.cr src/hunspell/lib_hunspell.cr.in \u003e src/hunspell/lib_hunspell.cr\n```\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/mamantoha/crystal-hunspell/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Anton Maminov](https://github.com/mamantoha) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmamantoha%2Fcrystal-hunspell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmamantoha%2Fcrystal-hunspell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmamantoha%2Fcrystal-hunspell/lists"}