{"id":16886514,"url":"https://github.com/reneklacan/symspell","last_synced_at":"2025-05-16T01:05:08.863Z","repository":{"id":34674538,"uuid":"128685005","full_name":"reneklacan/symspell","owner":"reneklacan","description":"Spelling correction \u0026 Fuzzy search based on Symmetric Delete spelling correction algorithm.","archived":false,"fork":false,"pushed_at":"2025-02-01T01:10:37.000Z","size":2637,"stargazers_count":136,"open_issues_count":3,"forks_count":32,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-13T19:14:26.677Z","etag":null,"topics":["rust","spellcheck","spelling-correction","symspell"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/reneklacan.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":"2018-04-08T21:54:09.000Z","updated_at":"2025-05-07T15:32:30.000Z","dependencies_parsed_at":"2024-10-26T21:17:37.538Z","dependency_job_id":"f644474f-1e58-4885-8b30-c57761bd888f","html_url":"https://github.com/reneklacan/symspell","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reneklacan%2Fsymspell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reneklacan%2Fsymspell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reneklacan%2Fsymspell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reneklacan%2Fsymspell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reneklacan","download_url":"https://codeload.github.com/reneklacan/symspell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254021595,"owners_count":22000953,"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":["rust","spellcheck","spelling-correction","symspell"],"created_at":"2024-10-13T16:40:05.078Z","updated_at":"2025-05-16T01:05:08.792Z","avatar_url":"https://github.com/reneklacan.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Documentation](https://docs.rs/symspell/badge.svg)](https://docs.rs/symspell)\n\n# SymSpell\n\nRust implementation of brilliant [SymSpell](https://github.com/wolfgarbe/SymSpell) originally written in C# by [@wolfgarbe](https://github.com/wolfgarbe).\n\n## Usage\n\n```rust\nextern crate symspell;\n\nuse symspell::{AsciiStringStrategy, SymSpell, Verbosity};\n\nfn main() {\n    let mut symspell: SymSpell\u003cAsciiStringStrategy\u003e = SymSpell::default();\n\n    symspell.load_dictionary(\"data/frequency_dictionary_en_82_765.txt\", 0, 1, \" \");\n    symspell.load_bigram_dictionary(\n      \"./data/frequency_bigramdictionary_en_243_342.txt\",\n      0,\n      2,\n      \" \"\n    );\n\n    let suggestions = symspell.lookup(\"roket\", Verbosity::Top, 2);\n    println!(\"{:?}\", suggestions);\n\n    let sentence = \"whereis th elove hehad dated forImuch of thepast who couqdn'tread in sixtgrade and ins pired him\";\n    let compound_suggestions = symspell.lookup_compound(sentence, 2);\n    println!(\"{:?}\", compound_suggestions);\n\n    let sentence = \"whereisthelove\";\n    let segmented = symspell.word_segmentation(sentence, 2);\n    println!(\"{:?}\", segmented);\n}\n```\n\nN.B. the dictionary entries have to be lowercase\n\n## Advanced Usage\n\n### Using Custom Settings\n\n```rust\nlet mut symspell: SymSpell\u003cAsciiStringStrategy\u003e = SymSpellBuilder::default()\n    .max_dictionary_edit_distance(2)\n    .prefix_length(7)\n    .count_threshold(1)\n    .build()\n    .unwrap()\n```\n\n### String Strategy\n\nString strategy is abstraction for string manipulation, for example preprocessing.\n\nThere are two strategies included:\n* `UnicodeStringStrategy`\n    * Doesn't do any prepocessing and handles strings as they are.\n* `AsciiStringStrategy`\n    * Transliterates strings into ASCII only characters.\n    * Useful when you are working with accented languages and you don't want to care about accents, etc\n\nTo configure string strategy just pass it as a type parameter:\n\n```rust\nlet mut ascii_symspell: SymSpell\u003cAsciiStringStrategy\u003e = SymSpell::default();\nlet mut unicode_symspell: SymSpell\u003cUnicodeStringStrategy\u003e = SymSpell::default();\n```\n\n### Javascript Bindings\n\nThis crate can be compiled against wasm32 target and exposes a SymSpell Class that can be used from Javascript as follow.\nOnly `UnicodeStringStrategy` is exported, meaning that if someone wants to manipulate ASCII only strings the dictionary and the sentences must be prepared in advance from JS.\n\n```javascript\nconst fs = require('fs');\nconst rust = require('./pkg');\n\nlet dictionary = fs.readFileSync('data/frequency_dictionary_en_82_765.txt');\nlet sentence = \"whereis th elove hehad dated forImuch of thepast who couqdn'tread in sixtgrade and ins pired him\";\n\nlet symspell = new rust.SymSpell({ max_edit_distance: 2,  prefix_length: 7,  count_threshold: 1});\nsymspell.load_dictionary(dictionary.buffer, { term_index: 0,  count_index: 1, separator: \" \"});\nsymspell.load_bigram_dictionary(bigram_dict.buffer, { term_index: 0,  count_index: 2, separator: \" \"});\nsymspell.lookup_compound(sentence, 1);\n```\n\nIt can be compiled using `wasm-pack` (eg. `wasm-pack build --release --target nodejs`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freneklacan%2Fsymspell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freneklacan%2Fsymspell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freneklacan%2Fsymspell/lists"}