{"id":22836611,"url":"https://github.com/code-theft-auto/string-search","last_synced_at":"2025-03-31T03:26:35.163Z","repository":{"id":130407147,"uuid":"482435261","full_name":"Code-Theft-Auto/String-Search","owner":"Code-Theft-Auto","description":"Tiny and fast string search in Go","archived":false,"fork":false,"pushed_at":"2023-03-01T09:59:09.000Z","size":18,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-06T08:13:52.145Z","etag":null,"topics":["algorithm","fuzzy-search","golang"],"latest_commit_sha":null,"homepage":"","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/Code-Theft-Auto.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":"2022-04-17T05:26:22.000Z","updated_at":"2022-04-27T19:02:20.000Z","dependencies_parsed_at":"2023-07-11T09:16:12.609Z","dependency_job_id":null,"html_url":"https://github.com/Code-Theft-Auto/String-Search","commit_stats":null,"previous_names":["bananaboii600/fuzzy-search"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Theft-Auto%2FString-Search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Theft-Auto%2FString-Search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Theft-Auto%2FString-Search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Theft-Auto%2FString-Search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Code-Theft-Auto","download_url":"https://codeload.github.com/Code-Theft-Auto/String-Search/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246410072,"owners_count":20772604,"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","golang"],"created_at":"2024-12-12T23:11:54.950Z","updated_at":"2025-03-31T03:26:35.144Z","avatar_url":"https://github.com/Code-Theft-Auto.png","language":"Go","readme":"\u003ch1 align=center\u003e\n\tString Search\n\u003c/h1\u003e\n\t\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/BananaBoii600/Fuzzy-Search/fuzzy\n```\n\n### Usage\n\n```go\npackage main\n\nimport \"github.com/BananaBoii600/Fuzzy-Search/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/BananaBoii600/Fuzzy-Search/fuzzy\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-theft-auto%2Fstring-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-theft-auto%2Fstring-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-theft-auto%2Fstring-search/lists"}