{"id":16101390,"url":"https://github.com/xdrop/fuzzywuzzy","last_synced_at":"2025-04-14T15:46:38.571Z","repository":{"id":37617274,"uuid":"67892933","full_name":"xdrop/fuzzywuzzy","owner":"xdrop","description":"Java fuzzy string matching implementation of the well known Python's fuzzywuzzy algorithm. Fuzzy search for Java","archived":false,"fork":false,"pushed_at":"2023-08-03T19:49:28.000Z","size":425,"stargazers_count":833,"open_issues_count":19,"forks_count":125,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-04-07T04:15:05.557Z","etag":null,"topics":["fuzzy-matching","fuzzy-search","fuzzywuzzy","java","python-levenshtein","string-distance"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xdrop.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":"2016-09-10T20:29:42.000Z","updated_at":"2025-04-01T09:01:38.000Z","dependencies_parsed_at":"2024-06-19T18:59:49.323Z","dependency_job_id":"e6b362a8-5b80-43c8-8220-0f34ba97e82e","html_url":"https://github.com/xdrop/fuzzywuzzy","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdrop%2Ffuzzywuzzy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdrop%2Ffuzzywuzzy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdrop%2Ffuzzywuzzy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdrop%2Ffuzzywuzzy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xdrop","download_url":"https://codeload.github.com/xdrop/fuzzywuzzy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248908607,"owners_count":21181563,"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","fuzzy-search","fuzzywuzzy","java","python-levenshtein","string-distance"],"created_at":"2024-10-09T18:49:49.031Z","updated_at":"2025-04-14T15:46:38.548Z","avatar_url":"https://github.com/xdrop.png","language":"Java","readme":"[![Maven Central](https://img.shields.io/maven-central/v/me.xdrop/fuzzywuzzy?logo=apache-maven\u0026style=flat-square)](https://search.maven.org/artifact/me.xdrop/fuzzywuzzy)\n\n# JavaWuzzy\n\n## FuzzyWuzzy Java Implementation\nFuzzy string matching for java based on the [FuzzyWuzzy](https://github.com/seatgeek/fuzzywuzzy) Python algorithm. The algorithm uses [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) to calculate similarity between strings.\n\nI've personally needed to use this but all of the other Java implementations out there either had a crazy amount of\ndependencies, or simply did not output the correct results as the python one, so I've decided to properly re-implement\nthis in Java. Enjoy!\n\n\n* No dependencies!\n* Includes implementation of the super-fast [python-Levenshtein](https://github.com/ztane/python-Levenshtein/) in Java!\n* Simple to use!\n* Lightweight!\n* Credits to the great folks at seatgeek for coming up with the algorithm ([More here](http://chairnerd.seatgeek.com/fuzzywuzzy-fuzzy-string-matching-in-python/))\n\n\n## Installation\n\nIn Maven and Gradle examples, remember to replace \"`VERSION`\" with the \n[latest release](https://search.maven.org/artifact/me.xdrop/fuzzywuzzy) of this\nlibrary.\n\n### Maven Central\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eme.xdrop\u003c/groupId\u003e\n    \u003cartifactId\u003efuzzywuzzy\u003c/artifactId\u003e\n    \u003cversion\u003eVERSION\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\n```gradle\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation 'me.xdrop:fuzzywuzzy:VERSION'\n}\n```\n\n### JPMS \n\nIf you use Java 9 or newer, and use the Java Platform Module System (JPMS), you will need to add\nthe following declarations to your `module-info.java` file:\n\n```java\nmodule my.modulename.here {\n    requires java.base;\n    requires me.xdrop.fuzzywuzzy;\n}\n```\n\n### Jar release\n\nDownload the latest release [here](https://github.com/xdrop/fuzzywuzzy/releases) and add to your classpath.\n\n## Usage\n\n#### Simple Ratio\n```groovy\nFuzzySearch.ratio(\"mysmilarstring\",\"myawfullysimilarstirng\")\n72\n\nFuzzySearch.ratio(\"mysmilarstring\",\"mysimilarstring\")\n97\n\n```\n\n#### Partial Ratio\n```groovy\nFuzzySearch.partialRatio(\"similar\", \"somewhresimlrbetweenthisstring\")\n71\n```\n\n#### Token Sort Ratio\n```groovy\nFuzzySearch.tokenSortPartialRatio(\"order words out of\",\"  words out of order\")\n100\nFuzzySearch.tokenSortRatio(\"order words out of\",\"  words out of order\")\n100\n```\n\n#### Token Set Ratio\n```groovy\nFuzzySearch.tokenSetRatio(\"fuzzy was a bear\", \"fuzzy fuzzy fuzzy bear\")\n100\nFuzzySearch.tokenSetPartialRatio(\"fuzzy was a bear\", \"fuzzy fuzzy fuzzy bear\")\n100\n```\n\n#### Weighted Ratio\n```groovy\nFuzzySearch.weightedRatio(\"The quick brown fox jimps ofver the small lazy dog\", \"the quick brown fox jumps over the small lazy dog\")\n97\n```\n\n#### Extract\n```groovy\n// groovy\n\nFuzzySearch.extractOne(\"cowboys\", [\"Atlanta Falcons\", \"New York Jets\", \"New York Giants\", \"Dallas Cowboys\"])\n(string: Dallas Cowboys, score: 90, index: 3)\n```\n```groovy\nFuzzySearch.extractTop(\"goolge\", [\"google\", \"bing\", \"facebook\", \"linkedin\", \"twitter\", \"googleplus\", \"bingnews\", \"plexoogl\"], 3)\n[(string: google, score: 83, index: 0), (string: googleplus, score: 63, index:5), (string: plexoogl, score: 43, index: 7)]\n```\n```groovy\nFuzzySearch.extractAll(\"goolge\", [\"google\", \"bing\", \"facebook\", \"linkedin\", \"twitter\", \"googleplus\", \"bingnews\", \"plexoogl\"]);\n[(string: google, score: 83, index: 0), (string: bing, score: 20, index: 1), (string: facebook, score: 29, index: 2), (string: linkedin, score: 29, index: 3), (string: twitter, score: 15, index: 4), (string: googleplus, score: 63, index: 5), (string: bingnews, score: 29, index: 6), (string: plexoogl, score: 43, index: 7)]\n// score cutoff\nFuzzySearch.extractAll(\"goolge\", [\"google\", \"bing\", \"facebook\", \"linkedin\", \"twitter\", \"googleplus\", \"bingnews\", \"plexoogl\"], 40) \n[(string: google, score: 83, index: 0), (string: googleplus, score: 63, index: 5), (string: plexoogl, score: 43, index: 7)]\n```\n```groovy\nFuzzySearch.extractSorted(\"goolge\", [\"google\", \"bing\", \"facebook\", \"linkedin\", \"twitter\", \"googleplus\", \"bingnews\", \"plexoogl\"]);\n[(string: google, score: 83, index: 0), (string: googleplus, score: 63, index: 5), (string: plexoogl, score: 43, index: 7), (string: facebook, score: 29, index: 2), (string: linkedin, score: 29, index: 3), (string: bingnews, score: 29, index: 6), (string: bing, score: 20, index: 1), (string: twitter, score: 15, index: 4)]\n// score cutoff\nFuzzySearch.extractSorted(\"goolge\", [\"google\", \"bing\", \"facebook\", \"linkedin\", \"twitter\", \"googleplus\", \"bingnews\", \"plexoogl\"], 3);\n[(string: google, score: 83, index: 0), (string: googleplus, score: 63, index: 5), (string: plexoogl, score: 43, index: 7)]\n```\n\n#### Extract using any object\n`extractOne` and related methods can receive `Collection\u003cT\u003e` and produce `BoundExtractedResult\u003cT\u003e`\n```java\nList\u003cFoo\u003e foo = ...;\nBoundExtractedResult\u003cFoo\u003e match = FuzzySearch.extractOne(\"cowboys\", foo, x -\u003e x.toString());\nFoo matchFoo = match.getReferent();\n```\n## Credits\n\n- seatgeek\n- Adam Cohen\n- David Necas (python-Levenshtein)\n- Mikko Ohtamaa (python-Levenshtein)\n- Antti Haapala (python-Levenshtein)\n- Tobias Burdow (burdoto)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxdrop%2Ffuzzywuzzy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxdrop%2Ffuzzywuzzy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxdrop%2Ffuzzywuzzy/lists"}