{"id":13507965,"url":"https://github.com/atom/node-spellchecker","last_synced_at":"2025-03-30T09:33:16.261Z","repository":{"id":7611337,"uuid":"8969615","full_name":"atom/node-spellchecker","owner":"atom","description":"SpellChecker Node Module","archived":true,"fork":false,"pushed_at":"2022-09-28T10:52:01.000Z","size":6756,"stargazers_count":300,"open_issues_count":64,"forks_count":108,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-18T09:36:43.012Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://atom.github.io/node-spellchecker","language":"C++","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/atom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-23T12:01:50.000Z","updated_at":"2025-01-27T06:55:34.000Z","dependencies_parsed_at":"2022-09-01T00:11:52.816Z","dependency_job_id":null,"html_url":"https://github.com/atom/node-spellchecker","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom%2Fnode-spellchecker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom%2Fnode-spellchecker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom%2Fnode-spellchecker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atom%2Fnode-spellchecker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atom","download_url":"https://codeload.github.com/atom/node-spellchecker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246301963,"owners_count":20755512,"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","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":[],"created_at":"2024-08-01T02:00:44.404Z","updated_at":"2025-03-30T09:33:15.079Z","avatar_url":"https://github.com/atom.png","language":"C++","readme":"##### Atom and all repositories under Atom will be archived on December 15, 2022. Learn more in our [official announcement](https://github.blog/2022-06-08-sunsetting-atom/)\n # SpellChecker Node Module [![CI](https://github.com/atom/node-spellchecker/actions/workflows/ci.yml/badge.svg)](https://github.com/atom/node-spellchecker/actions/workflows/ci.yml)\n\nNative bindings to [NSSpellChecker](https://developer.apple.com/library/mac/#documentation/cocoa/reference/ApplicationKit/Classes/NSSpellChecker_Class/Reference/Reference.html), [Hunspell](http://hunspell.sourceforge.net/), or the [Windows 8 Spell Check API](https://msdn.microsoft.com/en-us/library/windows/desktop/hh869853(v=vs.85).aspx), depending on your platform. Windows 7 and below as well as Linux will rely on Hunspell.\n\n## Installing\n\n```bash\nnpm install spellchecker\n```\n\n## Using\n\n```coffeescript\nSpellChecker = require 'spellchecker'\n```\n\n### SpellChecker.isMisspelled(word)\n\nCheck if a word is misspelled.\n\n`word` - String word to check.\n\nReturns `true` if the word is misspelled, `false` otherwise.\n\n### SpellChecker.getCorrectionsForMisspelling(word)\n\nGet the corrections for a misspelled word.\n\n`word` - String word to get corrections for.\n\nReturns a non-null but possibly empty array of string corrections.\n\n### SpellChecker.checkSpelling(corpus)\n\nIdentify misspelled words in a corpus of text.\n\n`corpus` - String corpus of text to spellcheck.\n\nReturns an Array containing `{start, end}` objects that describe an index range within the original String that contains a misspelled word.\n\n### SpellChecker.checkSpellingAsync(corpus)\n\nAsynchronously identify misspelled words.\n\n`corpus` - String corpus of text to spellcheck.\n\nReturns a Promise that resolves with the Array described by `checkSpelling()`.\n\n### SpellChecker.add(word)\n\nAdds a word to the dictionary.\nWhen using Hunspell, this will not modify the .dic file; new words must be added each time the spellchecker is created. Use a custom dictionary file.\n\n`word` - String word to add.\n\nReturns nothing.\n\n### new Spellchecker()\n\nIn addition to the above functions that are used on a default instance, a new instance of SpellChecker can be instantiated with the use of the `new` operator. The same methods are available with the instance but the dictionary and underlying API can be changed independently from the default instance.\n\n```javascript\nconst checker = new SpellChecker.Spellchecker()\n```\n\n#### SpellChecker.Spellchecker.setSpellcheckerType(type)\n\nOverrides the library selection for checking. Without this, the checker will use [Hunspell](http://hunspell.github.io/) on Linux, the [Spell Checking API](https://docs.microsoft.com/en-us/windows/desktop/intl/spell-checker-api) for Windows, and [NSSpellChecker](https://developer.apple.com/documentation/appkit/nsspellchecker) on Macs.\n\nIf the environment variable `SPELLCHECKER_PREFER_HUNSPELL` is set to any value, the library will fallback to always using the Hunspell implementation.\n\nThis is the same behavior as calling `setSpellcheckerType` with the `USE_SYSTEM_DEFAULTS` constant:\n\n```coffeescript\nchecker = new SpellChecker.Spellchecker\nchecker.setSpellcheckerType SpellChecker.USE_SYSTEM_DEFAULTS\n```\n\nTo always use the system API and not fallback to Hunspell regardless of the environment variable, use the `ALWAYS_USE_SYSTEM` constant:\n\n```coffeescript\nchecker = new SpellChecker.Spellchecker\nchecker.setSpellcheckerType SpellChecker.ALWAYS_USE_SYSTEM\n```\n\nLikewise, Hunspell can be forced with the `ALWAYS_USE_HUNSPELL` constant.\n\n```javascript\nconst checker = new SpellChecker.Spellchecker();\nchecker.setSpellcheckerType(SpellChecker.ALWAYS_USE_SYSTEM);\n```\n\nOn Linux, Hunspell is always used regardless of the setting. This method must also be called before any spelling is done otherwise it will throw an error.\n\nThis returns nothing.\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatom%2Fnode-spellchecker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatom%2Fnode-spellchecker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatom%2Fnode-spellchecker/lists"}