{"id":13424435,"url":"https://github.com/hugopl/fzy","last_synced_at":"2025-07-07T19:33:28.294Z","repository":{"id":81517267,"uuid":"235941383","full_name":"hugopl/fzy","owner":"hugopl","description":"A Crystal port of awesome Fzy project, a fuzzy finder algorithm.","archived":false,"fork":false,"pushed_at":"2024-11-14T14:43:29.000Z","size":85,"stargazers_count":46,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-31T02:41:15.472Z","etag":null,"topics":["crystal","fuzzy-search","fzy"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/hugopl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-01-24T04:50:41.000Z","updated_at":"2025-01-12T08:16:33.000Z","dependencies_parsed_at":"2024-01-27T09:09:35.549Z","dependency_job_id":"ed6bd504-2f1b-43c4-952a-3aeb730c4c84","html_url":"https://github.com/hugopl/fzy","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugopl%2Ffzy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugopl%2Ffzy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugopl%2Ffzy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugopl%2Ffzy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hugopl","download_url":"https://codeload.github.com/hugopl/fzy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252768751,"owners_count":21801371,"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":["crystal","fuzzy-search","fzy"],"created_at":"2024-07-31T00:00:54.288Z","updated_at":"2025-05-06T20:42:49.265Z","avatar_url":"https://github.com/hugopl.png","language":"Crystal","funding_links":[],"categories":["Crystal","Algorithms and Data structures"],"sub_categories":[],"readme":"# fzy.cr\n\n![Build Status](https://github.com/hugopl/fzy/actions/workflows/ci.yml/badge.svg?branch=main)\n\nA Crystal port of awesome [Fzy](https://github.com/jhawthorn/fzy) fuzzy finder algorithm.\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n```yaml\ndependencies:\n  fzy:\n    github: hugopl/fzy\n```\n\n2. Run `shards install`\n\n## Usage\n\nBasic usage:\n\n```crystal\nrequire \"fzy\"\n\nmatches = Fzy.search(\"hey\", %w(Hey Whatever Halley), store_positions: true)\nmatches.each do |match|\n  puts \"value: #{match.item}\"\n  puts \"score: #{match.score}\"\n  puts \"  pos: #{match.positions.inspect}\"\nend\n```\n\nShould print\n\n```\nvalue: Hey\nscore: Infinity\n  pos: [0, 1, 2]\nvalue: Halley\nscore: 1.87\n  pos: [0, 4, 5]\n```\n\nIf you need to do many searches on the same set of data you can speed up things by\ncreating an `Fzy::PreparedHaystack` or an array of `Fzy::Hay`.\n\n```crystal\nrequire \"fzy\"\n\nhaystack = %w(Hey Halley Whatever)\nprepared_haystack = Fzy::PreparedHaystack.new(haystack)\nmatches = Fzy.search(\"hey\", prepared_haystack)\nmatches.each do |match|\n  puts \"value: #{match.item}\"\n  puts \"score: #{match.score}\"\n  puts \"  pos: #{match.positions.inspect}\"\nend\n\n# Reusing the prepared haystack makes the search faster.\nmatches = Fzy.search(\"ho let's go!\", prepared_haystack)\n```\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/hugopl/fzy/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Hugo Parente Lima](https://github.com/hugopl) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugopl%2Ffzy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugopl%2Ffzy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugopl%2Ffzy/lists"}