{"id":13581747,"url":"https://github.com/lithammer/fuzzysearch","last_synced_at":"2025-05-13T18:12:25.951Z","repository":{"id":35180477,"uuid":"39438126","full_name":"lithammer/fuzzysearch","owner":"lithammer","description":":pig: Tiny and fast fuzzy search in Go","archived":false,"fork":false,"pushed_at":"2025-04-01T01:47:14.000Z","size":147,"stargazers_count":1192,"open_issues_count":12,"forks_count":61,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-04-25T17:52:35.963Z","etag":null,"topics":["algorithm","fuzzy-search","go"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/lithammer/fuzzysearch","language":"Go","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/lithammer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":"lithammer"}},"created_at":"2015-07-21T10:01:44.000Z","updated_at":"2025-04-24T00:06:37.000Z","dependencies_parsed_at":"2024-01-01T10:24:42.346Z","dependency_job_id":"50921604-25ef-4bd5-a7f6-cef61bad63c6","html_url":"https://github.com/lithammer/fuzzysearch","commit_stats":{"total_commits":117,"total_committers":15,"mean_commits":7.8,"dds":0.6666666666666667,"last_synced_commit":"44df725345d0609412cd10ed845b19575eb97854"},"previous_names":["renstrom/fuzzysearch"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithammer%2Ffuzzysearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithammer%2Ffuzzysearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithammer%2Ffuzzysearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithammer%2Ffuzzysearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lithammer","download_url":"https://codeload.github.com/lithammer/fuzzysearch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254000857,"owners_count":21997442,"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":["algorithm","fuzzy-search","go"],"created_at":"2024-08-01T15:02:13.255Z","updated_at":"2025-05-13T18:12:25.917Z","avatar_url":"https://github.com/lithammer.png","language":"Go","readme":"# Fuzzy Search\n\nInspired by [bevacqua/fuzzysearch][1], a fuzzy matching library written in\nJavaScript. But contains some extras like ranking using [Levenshtein\ndistance][2] and finding matches in a list of words.\n\nFuzzy searching allows for flexibly matching a string with partial input,\nuseful for filtering data very quickly based on lightweight user input.\n\nThe current implementation uses the algorithm suggested by Mr. Aleph, a russian\ncompiler engineer working at V8.\n\n## Install\n\n```\ngo get github.com/lithammer/fuzzysearch/fuzzy\n```\n\n## Usage\n\n```go\npackage main\n\nimport \"github.com/lithammer/fuzzysearch/fuzzy\"\n\nfunc main() {\n\tfuzzy.Match(\"twl\", \"cartwheel\")  // true\n\tfuzzy.Match(\"cart\", \"cartwheel\") // true\n\tfuzzy.Match(\"cw\", \"cartwheel\")   // true\n\tfuzzy.Match(\"ee\", \"cartwheel\")   // true\n\tfuzzy.Match(\"art\", \"cartwheel\")  // true\n\tfuzzy.Match(\"eeel\", \"cartwheel\") // false\n\tfuzzy.Match(\"dog\", \"cartwheel\")  // false\n\tfuzzy.Match(\"kitten\", \"sitting\") // false\n\t\n\tfuzzy.RankMatch(\"kitten\", \"sitting\") // -1\n\tfuzzy.RankMatch(\"cart\", \"cartwheel\") // 5\n\t\n\twords := []string{\"cartwheel\", \"foobar\", \"wheel\", \"baz\"}\n\tfuzzy.Find(\"whl\", words) // [cartwheel wheel]\n\t\n\tfuzzy.RankFind(\"whl\", words) // [{whl cartwheel 6 0} {whl wheel 2 2}]\n\t\n\t// Unicode normalized matching.\n\tfuzzy.MatchNormalized(\"cartwheel\", \"cartwhéél\") // true\n\n\t// Case insensitive matching.\n\tfuzzy.MatchFold(\"ArTeeL\", \"cartwheel\") // true\n}\n```\n\nYou can sort the result of a `fuzzy.RankFind()` call using the [`sort`][3]\npackage in the standard library:\n\n```go\nmatches := fuzzy.RankFind(\"whl\", words) // [{whl cartwheel 6 0} {whl wheel 2 2}]\nsort.Sort(matches) // [{whl wheel 2 2} {whl cartwheel 6 0}]\n```\n\nSee the [`fuzzy`][4] package documentation for more examples.\n\n## License\n\nMIT\n\n[1]: https://github.com/bevacqua/fuzzysearch\n[2]: http://en.wikipedia.org/wiki/Levenshtein_distance\n[3]: https://golang.org/pkg/sort/\n[4]: https://pkg.go.dev/github.com/lithammer/fuzzysearch/fuzzy\n","funding_links":["https://github.com/sponsors/lithammer"],"categories":["开源类库","Repositories","Go","Open source library"],"sub_categories":["搜索推荐","Search Recommendations"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flithammer%2Ffuzzysearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flithammer%2Ffuzzysearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flithammer%2Ffuzzysearch/lists"}