{"id":23639035,"url":"https://github.com/inaka/sheldon","last_synced_at":"2025-10-07T03:38:00.692Z","repository":{"id":10673299,"uuid":"66585214","full_name":"inaka/sheldon","owner":"inaka","description":"Very Simple Erlang Spell Checker","archived":false,"fork":false,"pushed_at":"2022-02-10T11:10:13.000Z","size":1598,"stargazers_count":63,"open_issues_count":5,"forks_count":10,"subscribers_count":37,"default_branch":"main","last_synced_at":"2025-09-11T13:50:56.469Z","etag":null,"topics":["erlang","erlang-spell-checker","hacktoberfest","sheldon","spelling-checker","spelling-correction"],"latest_commit_sha":null,"homepage":"","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inaka.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-25T19:03:27.000Z","updated_at":"2025-08-27T12:10:06.000Z","dependencies_parsed_at":"2022-08-07T06:00:17.533Z","dependency_job_id":null,"html_url":"https://github.com/inaka/sheldon","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/inaka/sheldon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inaka%2Fsheldon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inaka%2Fsheldon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inaka%2Fsheldon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inaka%2Fsheldon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inaka","download_url":"https://codeload.github.com/inaka/sheldon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inaka%2Fsheldon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278717080,"owners_count":26033535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["erlang","erlang-spell-checker","hacktoberfest","sheldon","spelling-checker","spelling-correction"],"created_at":"2024-12-28T08:11:43.969Z","updated_at":"2025-10-07T03:38:00.662Z","avatar_url":"https://github.com/inaka.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](http://i.giphy.com/M3EZtLUDLsYP6.gif)\n\n# Sheldon\n[![Hex.pm Version][hexpm version]][hexpm]\n[![Hex.pm Downloads][hexpm downloads]][hexpm]\n[![Coverage Status][coveralls badge]][coveralls]\n[![Build Status][gh badge]][gh]\n[![Erlang Versions][erlang version badge]][gh]\n\nVery Simple Erlang Spell Checker.\n\n__Note:__ `Sheldon` also suggests correct words when some word is misspelled. That functionality was highly inspired by the Elixir project [spell_check](https://github.com/visar/spell_check).\n\n\n## Contact Us\nIf you find any **bugs** or have a **problem** while using this library, please\n[open an issue](https://github.com/inaka/sheldon/issues/new) in this repo\n(or a pull request :)).\n\nAnd you can check all of our open-source projects at [inaka.github.io](http://inaka.github.io).\n\n## Installation\n\n_NOTE_ `sheldon` only works with Erlang 21 or greater\n\n1. Clone the repo\n2. `rebar3 compile`\n\n## Usage\n\n### Erlang Shell\n\nFirst of all Sheldon is an application and it needs to be started. You can use `rebar3 shell` to set the necessary paths, then use `sheldon:start/0` or `application:ensure_all_started(sheldon)` in order to start Sheldon but if you are using Sheldon as a dependency you can let OTP starts it from your_app.app file too.\n\nSheldon only has two main methods, `sheldon:check/1` and `sheldon:check/2`. As a user, you just need to use those.\n\n```erlang\n1\u003e sheldon:check(\"I want to check this correct text\").\nok\n2\u003e sheldon:check(\"I want to check this misspeled text\").\n#{bazinga =\u003e \u003c\u003c\"That's no reason to cry. One cries because one is sad. For example, I cry because others are stupid, and that ma\"...\u003e\u003e,\n  misspelled_words =\u003e [#{candidates =\u003e [\"misspeed\",\"misspelled\"],\n     line_number =\u003e 1,\n     word =\u003e \"misspeled\"}]}\n```\n\n## Configuration\n\n`sheldon:check/2` works like `sheldon:check/1` but it accepts a Configuration parameter.\nWith this Conf parameter we can apply some rules to the text we want to check. Those rules are ignore words, ignore patterns and ignore blocks.\n\nThis is the format (see [sheldon_config.erl](https://github.com/inaka/sheldon/blob/master/src/sheldon_config.erl)), no key is required:\n\n```erlang\n#{ ignore_words    =\u003e [string()]\n , ignore_patterns =\u003e [regex()]\n , ignore_blocks   =\u003e [ignore_block()]\n , adapters        =\u003e [adapter()]\n }.\n```\nThen, if we call the previous `sheldon:check/1` but with configuration we can skip the error\n\n```erlang\n3\u003e sheldon:check(\"I want to check this misspeled text\", #{ignore_words =\u003e [\"misspeled\"]}).\nok\n```\n\n## Adapters\n\nSometimes we have to check the spelling of formatted text but `sheldon` handles it as a plain text so we will face problems with that.\nOne example is `markdown` files, if we try to check them `sheldon` will complain about things like '##' or '\\*something\\*'.\nFor these cases `sheldon` provides `adapters`. An adapter is an Erlang module with an `adapt/1` function which will receive a line in `binary()` format and returns that line transformed.\nFor example, `sheldon` provides [markdown_adapter](https://github.com/inaka/sheldon/blob/master/src/adapter/markdown_adapter.erl) which converts from `markdown` to plain text.\n\nIn order to use them we only have to declare them in the config file:\n\n```erlang\n#{adapters =\u003e [markdown_adapter]}.\n```\n\nYou can create your own adapter which fits your requirements, you only need to implement the `sheldon_adapter` behavior and to provide some code to `adapt/1` function.\n\n```erlang\n-spec adapt(binary()) -\u003e iodata().\nadapt(Line) -\u003e\n  ...\n```\n\nYou can add all the adapters you want and they will be executed in order.\n\n## Examples\nCheck [this](examples/README.md) out.\n\n## Results\n\n`sheldon:check/1` and `sheldon:check/2` have the same result type, you can see [sheldon_result.erl](https://github.com/inaka/sheldon/blob/master/src/sheldon_result.erl). Sheldon will return the `ok` atom if the check went well else it'll return\n```erlang\n    #{ misspelled_words := [misspelled_word()]\n     , bazinga          := string()\n     }.\n```\n\n`misspelled_word`'s list will be returned ordered by line number. If more than one misspelled word per line appears they will be ordered by order of appearance.\n\n## Dependencies\n\n**Required OTP version 23** or or higher. We only provide guarantees that the system runs on OTP23+ since that's what we're testing it in, but the `minimum_otp_vsn` is `\"21\"` because some systems where **sheldon** is integrated do require it.\n\n\u003c!-- Badges --\u003e\n[hexpm]: https://hex.pm/packages/sheldon\n[hexpm version]: https://img.shields.io/hexpm/v/sheldon.svg?style=flat-square\n[hexpm downloads]: https://img.shields.io/hexpm/dt/sheldon.svg?style=flat-square\n[gh]: https://github.com/inaka/sheldon/actions/workflows/ci.yml\n[gh badge]: https://img.shields.io/github/workflow/status/inaka/sheldon/CI?style=flat-square\n[coveralls]: https://coveralls.io/github/inaka/sheldon\n[coveralls badge]: https://img.shields.io/coveralls/inaka/sheldon/master.svg?style=flat-square\n[erlang version badge]: https://img.shields.io/badge/erlang-23.0%20to%2024.1-blue.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finaka%2Fsheldon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finaka%2Fsheldon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finaka%2Fsheldon/lists"}