{"id":28450586,"url":"https://github.com/esukhia/sympound-python","last_synced_at":"2025-07-18T05:07:41.072Z","repository":{"id":57472869,"uuid":"137581762","full_name":"Esukhia/sympound-python","owner":"Esukhia","description":"Python version of the SymSpell Compound algorithm","archived":false,"fork":false,"pushed_at":"2018-09-18T10:46:46.000Z","size":19,"stargazers_count":12,"open_issues_count":2,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-09T10:19:16.292Z","etag":null,"topics":["spellcheck"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/sympound/","language":"Python","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/Esukhia.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":"2018-06-16T13:12:42.000Z","updated_at":"2024-04-18T23:17:00.000Z","dependencies_parsed_at":"2022-09-19T11:51:21.278Z","dependency_job_id":null,"html_url":"https://github.com/Esukhia/sympound-python","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Esukhia/sympound-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esukhia%2Fsympound-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esukhia%2Fsympound-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esukhia%2Fsympound-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esukhia%2Fsympound-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Esukhia","download_url":"https://codeload.github.com/Esukhia/sympound-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Esukhia%2Fsympound-python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265703582,"owners_count":23814033,"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":["spellcheck"],"created_at":"2025-06-06T15:08:08.780Z","updated_at":"2025-07-18T05:07:41.062Z","avatar_url":"https://github.com/Esukhia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sympound-python\n\nThis library is an implementation of the [SymSpellCompound](https://github.com/wolfgarbe/SymSpell) algorithm in Python. It was initially forked from [rcourivaud/symspellcompound](https://github.com/rcourivaud/symspellcompound) although most of the code has been rewritten.\n\n# Installation\n\n```\npip install sympound\n```\n\n# Documentation\n\nIf you want a quick complete example, see [example.py](example.py).\n\n### Creating the sympound object\n\nThe first step is to create an `sympound` object, the constructor takes two main arguments:\n\n- `distancefun` is a function that will be used to compute the distance between two strings. It takes two arguments (the two strings to compare). You typically want to use a function computing the [Damerau-Levenshtein distance](https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance), but you can get more creative and use keyboard distances.\n- `maxDictionaryEditDistance` is the maximum distance that will be pre-computed. Increasing this parameter will return more suggestions, but also make the memory print much larger\n\n### adding dictionaries\n\nThen some dictionaries can be added through the `load_dictionary(filename)` function, typically taking a file path as argument. The format of the dictionary is typically either a list of words (one per line), or a list of word and frequency (separated by a space). See [example-dict.txt](example-dict.txt) for an example.\n\nYou can also add entries directly with `create_dictionary_entry(key, count)` where `key` is the valid string and `count` the frequency associated with it. This is the advised method to use if your data is not in a simple format like the previously described dictionary.\n\nA lot of computations happen at this stage and adding a large number of entries can easily take more than one minute, so we provide two functions to save the analyzed ductionaries as a pickle: `save_pickle(filename)` and `load_pickle(filename)`, both taking a file path as argument. Note that the pickled is gzipped.\n\n### Lookup\n\nOnce the dictionaries are loaded, you can get suggestions for a string by calling `lookup_compound(str, edit_distance_max)`, where `str` is the string you want to analyze and `edit_distance_max` is the maximum distance you want suggestions for.\n\nThe function returns a sorted list of `SuggestItem`s, containing three fields:\n\n- `term` being the suggested fixed string\n- `distance` being the distance with the original string\n- `count` being the frequency if given in the dictionary\n\n# Maintainance\n\nUpload on pip:\n\n```\npython setup.py sdist\ntwine upload dist/*\n```\n\n# Copyright\n\nThe code is Copyright Esukhia, 2018, and is distributed under the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesukhia%2Fsympound-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesukhia%2Fsympound-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesukhia%2Fsympound-python/lists"}