{"id":16832138,"url":"https://github.com/mightguy/customized-symspell","last_synced_at":"2025-03-22T04:30:43.339Z","repository":{"id":55666918,"uuid":"219670653","full_name":"MighTguY/customized-symspell","owner":"MighTguY","description":"Java port of  SymSpell: 1 million times faster through Symmetric Delete spelling correction algorithm ","archived":false,"fork":false,"pushed_at":"2020-12-15T07:46:00.000Z","size":9016,"stargazers_count":67,"open_issues_count":5,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-18T08:11:14.296Z","etag":null,"topics":["damerau-levenshtein","java-8","levenshtein-distance","qwerty-based-char-distance","spellchecker","spelling-correction","symspell","weighted-damerau-levenshtein","word-segmentation"],"latest_commit_sha":null,"homepage":"","language":"Java","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/MighTguY.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-11-05T06:10:05.000Z","updated_at":"2025-03-09T20:54:18.000Z","dependencies_parsed_at":"2022-08-15T06:00:45.897Z","dependency_job_id":null,"html_url":"https://github.com/MighTguY/customized-symspell","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MighTguY%2Fcustomized-symspell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MighTguY%2Fcustomized-symspell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MighTguY%2Fcustomized-symspell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MighTguY%2Fcustomized-symspell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MighTguY","download_url":"https://codeload.github.com/MighTguY/customized-symspell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244907420,"owners_count":20529850,"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":["damerau-levenshtein","java-8","levenshtein-distance","qwerty-based-char-distance","spellchecker","spelling-correction","symspell","weighted-damerau-levenshtein","word-segmentation"],"created_at":"2024-10-13T11:47:49.074Z","updated_at":"2025-03-22T04:30:40.272Z","avatar_url":"https://github.com/MighTguY.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Travis Build Status](https://travis-ci.org/MighTguY/customized-symspell.svg?branch=master)\n[![Coverage Status](https://coveralls.io/repos/github/MighTguY/customized-symspell/badge.svg)](https://coveralls.io/github/MighTguY/customized-symspell)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://raw.githubusercontent.com/MighTguY/customized-symspell/master/LICENSE)\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.mightguy/symspell-lib.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.mightguy%22%20AND%20a:%22symspell-lib%22)\n[![javadoc.io](https://javadoc.io/badge2/io.github.mightguy/symspell-lib/javadoc.io.svg)](https://javadoc.io/doc/io.github.mightguy/symspell-lib)\n\n# Customized SymSpell SpellCheck Java \n**This customized spell check is is based on the spell correction fuzzy search library [SymSpell](https://github.com/wolfgarbe/symspell) with a few customizations and optimizations**  \n\n## Java Ported v6.6 (Bigrams)\n* the optional bigram dictionary in order to use sentence level context information for selecting best spelling correction.\n\n\n## SymSpell\n* The Symmetric Delete spelling correction algorithm reduces the complexity of edit candidate generation and dictionary lookup for a given Damerau-Levenshtein distance. \n* It is six orders of magnitude faster (than the standard approach with deletes + transposes + replaces + inserts) and language independent.\n* Opposite to other algorithms only deletes are required, no transposes + replaces + inserts. Transposes + replaces + inserts of the input term are transformed into deletes of the dictionary term.\n* The speed comes from the inexpensive delete-only edit candidate generation and the pre-calculation.\n\n## Customizations\n* We replaced the **Damerau-Levenshtein** implementation with a **weighted Damerau-Levenshtein** implementation: where each operation (delete, insert, swap, replace) can have different edit weights.\n* We added some customizing \"hooks\" that are used to rerank the top-k results (candidate list). The results are then reordered based on a combined proximity\n  * added keyboard-distance to get a dynamic replacement weight (since letters close to each other are more likely to be replaced)\n  * do some query normalization before search\n  \n## Keyboard based  Qwerty/Qwertz Distance\n\nThere are 2 implementations of the keyboards one is English Qwerty based and other is German Qwertz based implementation\nwe used the adjancey graph of the keyboard for the weights to the connected nodes.\n\u003cimg src=\"qwerty.png\" align=\"center\"\u003e\n\n### Example\n```\nFor 2 terms: \n        slices  \n        olives\n\nIf the misspelled word is, slives \nboth slices and olives is 1 edit distnace, \n  so in default case the one with higher frequency will end up in the result.\nWhile with the qwerty based char distance,\n slives is more closer to slices.\n\nThe reason for this is in Qwerty Based Keyboard, \n S and O are too far while V and C are adjacent.\n```\n\n## Generation of Deletes\n\nWord deletes are generated with taking edit distance which is minimum of max edit distance and 0.3 * word.length\n  \n## [Usage](symspell-lib/README.md)\n\n## [Solr Usage](symspell-solr/README.md)\n\n## Accuracy Summary\n\n\u003e Indexed Docs: 3695 \n\n\u003eSearches: 8060\n\n| Spellcorrection Strategy \t| Accuracy \t| Failures \t| TP   \t| TN  \t| FP  \t| FN   \t|\n|--------------------------\t|:--------:\t|---------:\t|------\t|-----\t|-----\t|------\t|\n| LUCENE                   \t|  78.96%  \t|   21.04% \t| 5883 \t| 481 \t| 146 \t| 1550 \t|\n| Vanilla SymSpell         \t|  88.80%  \t|   11.20% \t| 6888 \t| 269 \t| 358 \t| 545  \t|\n| Weighted SymSpell        \t|  75.74%  \t|   24.26% \t| 5781 \t| 324 \t| 303 \t| 1652 \t|\n| Qwerty Vanilla SymSpell  \t| 88.57%   \t| 11.43%   \t| 6860 \t| 279 \t| 348 \t| 573  \t|\n| Qwerty Weighted SymSpell \t| 75.36%   \t| 24.64%   \t| 5744 \t| 330 \t| 297 \t| 1689 \t|\n\n## Benchmark Summary\nWe have done 3 runs each for 30k and 80k data set, which also includes results for each verbosity level.\nAfter the runs the final benchmarking looks like: \n```\nAverage Precalculation time instance 30843.33 ms\nAverage Lookup time instance 138141.09296296295 ns ~ 0.03814 ms\nTotal Lookup results instance 648092\n``` \n[More  Detailed summary](symspell-benchmark/README.md)\n  \n## Built With\n\n* [Maven]()\n\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. \n\n## Nexus\n* [Link to Nexus-Releases](https://oss.sonatype.org/service/local/repositories/releases/content/io/github/mightguy/symspell-lib/)\n\n## Licenese\n\n````\nThe MIT License (MIT)\nCopyright © 2019 Lucky Sharma ( https://github.com/MighTguY/customized-symspell )\nCopyright © 2018 Wolf Garbe (Original C# implementation https://github.com/wolfgarbe/SymSpell )\n\nPermission is hereby granted, free of charge, to any person \nobtaining a copy of this software and associated documentation files\n(the “Software”), to deal in the Software without restriction, \nincluding without limitation the rights to use, copy, modify,\nmerge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is \nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall \nbe included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, \nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, \nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR \nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR \nTHE USE OR OTHER DEALINGS IN THE SOFTWARE.\n````\n\n## Special Mentions\n[Sachin Lala](https://github.com/sachinlala/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmightguy%2Fcustomized-symspell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmightguy%2Fcustomized-symspell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmightguy%2Fcustomized-symspell/lists"}