{"id":27298494,"url":"https://github.com/mathieuloutre/node-symspell","last_synced_at":"2025-04-12T00:27:25.091Z","repository":{"id":47924766,"uuid":"230954185","full_name":"MathieuLoutre/node-symspell","owner":"MathieuLoutre","description":"JavaScript port of SymSpell for Node.js","archived":false,"fork":false,"pushed_at":"2022-09-30T15:18:25.000Z","size":8391,"stargazers_count":10,"open_issues_count":9,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-04-10T07:42:00.591Z","etag":null,"topics":["autocorrect","spellcheck","spellchecker","spellchecking","spelling","spelling-checker","spelling-correction","spelling-suggestions","symspell"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/MathieuLoutre.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}},"created_at":"2019-12-30T17:27:02.000Z","updated_at":"2023-01-19T20:53:31.000Z","dependencies_parsed_at":"2023-01-18T19:30:58.885Z","dependency_job_id":null,"html_url":"https://github.com/MathieuLoutre/node-symspell","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuLoutre%2Fnode-symspell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuLoutre%2Fnode-symspell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuLoutre%2Fnode-symspell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathieuLoutre%2Fnode-symspell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MathieuLoutre","download_url":"https://codeload.github.com/MathieuLoutre/node-symspell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248499181,"owners_count":21114266,"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":["autocorrect","spellcheck","spellchecker","spellchecking","spelling","spelling-checker","spelling-correction","spelling-suggestions","symspell"],"created_at":"2025-04-12T00:27:24.576Z","updated_at":"2025-04-12T00:27:25.081Z","avatar_url":"https://github.com/MathieuLoutre.png","language":"JavaScript","readme":"# node-symspell\nJavaScript port of SymSpell 6.6 based on the [original C# version by Wolf Garde](https://github.com/wolfgarbe/SymSpell) and the [Python version by mammothb](https://github.com/mammothb/symspellpy).\n\nJust like the Python version, this cuts out some of the C# memory optimisation which aren't really relevant in JavaScript. As a result, this port is not optimised for speed, though it's still quite fast.\n\nThis version also includes the additions of the Python version such as the `ignoreToken` and `transferCasing` options. The unit tests provided are those of the Python version which are much more comprehensive than the original ones.\n\nThis library uses the `iter-tools` and `difflib` modules which are Javascript ports of the Python modules with similar names. Because it uses async/await and async generators, it needs at least Node 12.x.\n\n**NOTE: this is still a work in progress and the API is likely to change**\n\n## Basic Example\n\n```js\nconst SymSpell = require('node-symspell')\n\nconst maxEditDistance = 2\nconst prefixLength = 7\nconst symSpell = new SymSpell(maxEditDistance, prefixLength)\nawait symSpell.loadDictionary(dictionaryPath, 0, 1)\nawait symSpell.loadBigramDictionary(bigramPath, 0, 2)\n\nconst typo = 'Can yu readthis messa ge despite thehorible sppelingmsitakes'\nconst results = symSpell.lookupCompound(typo, maxEditDistance)\n\nconsole.log(results[0])\n// {\n// \tterm: 'can you read this message despite the horrible spelling mistakes',\n// \tdistance: 10,\n// \tcount: 0\n// } \n```\n\n## Main API overview\n\n`constructor (maxDictionaryEditDistance = 2, prefixLength = 7, countThreshold = 1)`\n\n`async loadDictionary (dictFile, termIndex, countIndex, separator = ' ')`\n\n`async loadBigramDictionary (dictFile, termIndex, countIndex, separator = ' ')`\n\n`lookup (input, verbosity, maxEditDistance = null, { includeUnknown, ignoreToken, transferCasing } = {})`\n\n`lookupCompound (input, maxEditDistance = null, { ignoreNonWords, transferCasing } = {})`\n\n`wordSegmentation (input, { maxEditDistance = null, maxSegmentationWordLength = null, ignoreToken } = {})`\n\n## References\n\nhttps://github.com/wolfgarbe/SymSpell  \nhttps://github.com/mammothb/symspellpy","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieuloutre%2Fnode-symspell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathieuloutre%2Fnode-symspell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathieuloutre%2Fnode-symspell/lists"}