{"id":26924963,"url":"https://github.com/bcvery1/levenshtein","last_synced_at":"2025-04-02T02:20:12.508Z","repository":{"id":285373175,"uuid":"956666990","full_name":"bcvery1/levenshtein","owner":"bcvery1","description":"Implementation of the Levenshtein Distance algorithm","archived":false,"fork":false,"pushed_at":"2025-03-31T10:31:57.000Z","size":19,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T11:29:22.126Z","etag":null,"topics":["autocomplete","autocompletion","cli","fuzzy","fuzzy-search","levenshtein","levenshtein-distance","tooling","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/bcvery1.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":"2025-03-28T16:40:04.000Z","updated_at":"2025-03-31T10:32:01.000Z","dependencies_parsed_at":"2025-03-31T11:39:49.161Z","dependency_job_id":null,"html_url":"https://github.com/bcvery1/levenshtein","commit_stats":null,"previous_names":["bcvery1/levenshtein"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcvery1%2Flevenshtein","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcvery1%2Flevenshtein/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcvery1%2Flevenshtein/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcvery1%2Flevenshtein/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcvery1","download_url":"https://codeload.github.com/bcvery1/levenshtein/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246741234,"owners_count":20826086,"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":["autocomplete","autocompletion","cli","fuzzy","fuzzy-search","levenshtein","levenshtein-distance","tooling","zig"],"created_at":"2025-04-02T02:20:11.890Z","updated_at":"2025-04-02T02:20:12.459Z","avatar_url":"https://github.com/bcvery1.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Levenshteien\nImplementation of the Levenshtein Distance algorithm in Zig.\n\n## Getting started\n\n### Adding as dependency\n\nFirst use the following command to add the dependency to your `build.zig.zon`:\n```sh\nzig fetch --save https://github.com/bcvery1/levenshtein/archive/refs/tags/[RELEASE VERSION].tar.gz\n```\n\nYou may wish to save the library with a specific name, for example:\n```sh\nzig fetch --save=lev https://github.com/bcvery1/levenshtein/archive/refs/tags/v0.1.0.tar.gz\n```\nWe'll use the name `lev` the next excerpt.\n\nNext you'll want to add the following to your `build.zig` file:\n```zig\nconst levenshtein = b.dependency(\"lev\", .{\n    .target = target,\n    .optimize = optimize,\n});\nexe.root_module.addImport(\"lev\", levenshtein.module(\"lev\");\n```\n\nYou can then import and use the library with `const lev = @import(\"lev\");`\n\n### Basic usage\n\nThis simple example shows how to use the library to sort and get the closest word to any in a dictionary:\n```zig\nconst std = @import(\"std\");\n\nconst lev = @import(\"lev\");\n\nconst assert = std.debug.assert;\n\nvar strs = [_][]const u8{\n    \"bread\",\n    \"vegetables\",\n    \"cheese\",\n    \"ale\",\n};\n\npub fn main() !void {\n    var gpa = std.heap.GeneralPurposeAllocator(.{}){};\n    defer _ = gpa.deinit();\n    const allocator = gpa.allocator();\n\n    const word1 = \"a\";\n    try lev.sort_in_place(allocator, word1, \u0026strs, .{});\n    assert(std.mem.eql(u8, \"ale\", strs[0]));\n\n    const word2 = \"vegeta\";\n    try lev.sort_in_place(allocator, word2, \u0026strs, .{});\n    assert(std.mem.eql(u8, \"vegetables\", strs[0]));\n}\n```\n\nFor more examples on usage, take a look at the [examples](https://github.com/bcvery1/levenshtein/tree/main/examples) directory.\n\n## Licence\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcvery1%2Flevenshtein","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcvery1%2Flevenshtein","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcvery1%2Flevenshtein/lists"}