{"id":17476687,"url":"https://github.com/rfgplk/fuzzy","last_synced_at":"2026-02-12T17:31:31.636Z","repository":{"id":258287773,"uuid":"870319548","full_name":"rfgplk/fuzzy","owner":"rfgplk","description":"an approximate string matching library written in C++","archived":false,"fork":false,"pushed_at":"2024-10-10T12:16:57.000Z","size":49,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-30T18:14:18.406Z","etag":null,"topics":["c-plus-plus","cplusplus","cpp","cpp-library","cpp20","edit-distance","edit-distance-algorithm","hamming-distance","header-only","levenshtein-distance"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rfgplk.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":"2024-10-09T20:29:22.000Z","updated_at":"2024-10-12T22:59:14.000Z","dependencies_parsed_at":"2024-10-19T01:16:36.536Z","dependency_job_id":null,"html_url":"https://github.com/rfgplk/fuzzy","commit_stats":null,"previous_names":["rfgplk/fuzzy"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rfgplk/fuzzy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfgplk%2Ffuzzy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfgplk%2Ffuzzy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfgplk%2Ffuzzy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfgplk%2Ffuzzy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rfgplk","download_url":"https://codeload.github.com/rfgplk/fuzzy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfgplk%2Ffuzzy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271578524,"owners_count":24784053,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["c-plus-plus","cplusplus","cpp","cpp-library","cpp20","edit-distance","edit-distance-algorithm","hamming-distance","header-only","levenshtein-distance"],"created_at":"2024-10-18T19:09:15.229Z","updated_at":"2026-02-12T17:31:26.605Z","avatar_url":"https://github.com/rfgplk.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/ddff98b7-a390-43a7-86b3-91ef5e4da6be\" alt=\"fuzzy_logo\" width=\"200\"/\u003e\n\n# Fuzzy\n### a C++ Hamming/Levenshtein distance approximate string matching library\n... so *fast* you'd think he was a **hash**. \n\u003c/div\u003e\n\nFuzzy is an extremely fast **approximate string matching** (fuzzy finding) library written in C++20.\n\nIt offers two primary modes of operation, one via the Hamming metric and the other via the Levenshtein distance (by means of the W-F algorithm). The Hamming metric is extremely efficient, being able to parse and match strings at speeds of ~3-4 GB/s per thread based on current testing (Haswell/Broadwell/Skylake). The second, more precise mode of operation, is via the Levenshtein metric, which is slower but offers more accurate hits. Requires AVX2. \n\n\n## Usage\n```cpp\nsimilar(string, string); // gauge approximate similarity of two strings\nmetric_hamming(token, string); // retrieve a raw Hamming metric\nmetric_lsh(token, string); // retrieve a raw Levenshtein metric\nrough_find(token, strings); // find an approximate string match by using the Hamming distance\nprecise_find(token, strings); // find a string match more precisely by using the Levenshetin distance\nfuzzy_find(token, strings); // search for occurance of token in strings\nfuzzy_exists(token, strings); // check if an exact match of a string exists\n```\n\n\n### Example\n```cpp\n#include \"src/fuzzy.hpp\"\nstd::string to_find = \"Hello\";\nstd::vector\u003cstd::string\u003e words = { \"apples\", \"ello\", \"chameleon\", \"asphalt\", \"behemoth\" };\nauto f = fuzzy::fuzzy_find(to_find, words, 3); // get top three results \nstd::string best_match = f(); // best match string by name\nlong double likelihood = f.likelihood(); // get likelihood of string match\nstd::string likelihood = f[n]; // get name of string at index, ordered from highest likelihood hit\n```\n\n## Installation\n\nFuzzy is a header only library. Just copy all files from `src/` and include `src/fuzzy.hpp` into your project.\n\n\n## TODO\n- [ ] add fuzzy_blob/fuzzy_bin\n- [ ] add full SSE support\n- [ ] expand AVX support via AVX-128 \\\u0026 AVX-512\n- [ ] more comprehensive unit test suite\n- [ ] add functionality for string streaming\n- [ ] C bindings\n\n## Misc\nno dependencies, requires C++20, tested with g++.\n\n## License\nLicensed under the Boost Software License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frfgplk%2Ffuzzy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frfgplk%2Ffuzzy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frfgplk%2Ffuzzy/lists"}