{"id":13895572,"url":"https://github.com/swarn/fzy-lua","last_synced_at":"2025-07-17T11:31:42.155Z","repository":{"id":56445803,"uuid":"305187724","full_name":"swarn/fzy-lua","owner":"swarn","description":"A lua implementation of the fzy fuzzy matching algorithm","archived":false,"fork":false,"pushed_at":"2024-03-08T17:19:56.000Z","size":65,"stargazers_count":72,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-25T01:31:47.686Z","etag":null,"topics":["fuzzy-matching-algorithm","fzy","lua"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/swarn.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":"2020-10-18T20:13:08.000Z","updated_at":"2024-11-21T23:57:19.000Z","dependencies_parsed_at":"2024-03-08T16:48:24.902Z","dependency_job_id":"6d32db00-adba-4335-a807-59aa96711984","html_url":"https://github.com/swarn/fzy-lua","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/swarn/fzy-lua","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swarn%2Ffzy-lua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swarn%2Ffzy-lua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swarn%2Ffzy-lua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swarn%2Ffzy-lua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swarn","download_url":"https://codeload.github.com/swarn/fzy-lua/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swarn%2Ffzy-lua/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265600590,"owners_count":23795721,"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":["fuzzy-matching-algorithm","fzy","lua"],"created_at":"2024-08-06T18:02:18.646Z","updated_at":"2025-07-17T11:31:41.917Z","avatar_url":"https://github.com/swarn.png","language":"Lua","readme":"# fzy-lua\n\n[![Actions Status](https://github.com/swarn/fzy-lua/workflows/build/badge.svg)](https://github.com/swarn/fzy-lua/actions)\n\nA Lua port of [fzy](https://github.com/jhawthorn/fzy)'s fuzzy string matching\nalgorithm. This includes both a pure Lua implementation and a compiled C\nimplementation with a Lua wrapper.\n\n\n## What does it do?\n\nFrom the original `fzy`:\n\n\u003e fzy is faster and shows better results than other fuzzy finders.\n\u003e\n\u003e Most other fuzzy matchers sort based on the length of a match. fzy tries to\n\u003e find the result the user intended. It does this by favouring matches on\n\u003e consecutive letters and starts of words. This allows matching using acronyms\n\u003e or different parts of the path.\n\nLet's give it a try:\n\n``` lua\nlocal fzy = require('fzy')\nlocal haystacks = {'cab', 'ant/bat/cat', 'ant/bat/ace'}\nlocal needle = 'abc'\nlocal result = fzy.filter(needle, haystacks)\n```\n\nHere is what `result` looks like:\n``` lua\n{\n  {2, {1, 5,  9}, 2.63},\n  {3, {1, 5, 10}, 1.725}\n}\n```\nWhich tells us:\n\n- We get a result from `filter` for each match. The string at index 1, `cab`,\n  did not match the query, because `abc` is not a subsequence of `cab`.\n\n- The string at index 2 matched with a score of 2.63. It matched characters at\n  the following positions:\n\n      ant/bat/cat\n      ^   ^   ^\n      1   5   9\n\n- The string at index 3 matched with a score of 1.725. It matched characters at\n  the following positions:\n\n      ant/bat/ace\n      ^   ^    ^\n      1   5    10\n\n  This match has a lower score than the previous string because `fzy` tries to\n  find what you intended, and one way it does that is by favoring matches at\n  the beginning of words.\n\n\n## Install\n\n``` sh\nluarocks install fzy\n```\n\nOr, just download a copy of `fzy_lua.lua` and drop it in your project.\n\n\n## Usage\n\nSee [the docs](docs/fzy.md).\n\n\n## Testing\n\n```sh\nluarocks test\n```\n\nOr, without luarocks:\n\n```sh\nbusted\n```\n\n\n## Thanks\n\nJohn Hawthorn wrote the original `fzy`. The native implementation here is\nbasically his code with a few tweaks, and the lua implementation is derived\nfrom his `fzy.js` implementation.\n\n[Rom Grk](https://github.com/romgrk) made several useful suggestions, and has a\n[lua C implemenation](https://github.com/romgrk/fzy-lua-native) using\nthe luajit `ffi` library.\n","funding_links":[],"categories":["Lua"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswarn%2Ffzy-lua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswarn%2Ffzy-lua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswarn%2Ffzy-lua/lists"}