Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some inconsistencies between FuzzyWuzzy's PartialRatio and Golang's #12

Open
adarsh1001 opened this issue May 22, 2024 · 0 comments
Open

Comments

@adarsh1001
Copy link

I'm currently porting a Python library that uses FuzzyWuzzy to calculate PartialRatio to Golang. Check out this example:

String 1: burg
String 2: pizza hut

The PartialRatio given by Python is 33 whereas go-fuzzywuzzy outputs 25 in this case.

Python Implementation:

>>> from thefuzz import fuzz
>>> fuzz.partial_ratio("burg", "pizza hut")
33

Golang Implementation:

import (
	"math"

	fuzzy "github.com/paul-mannino/go-fuzzywuzzy"
)

func CalculatePartialRatio(str1, str2 string) int {
	return fuzzy.PartialRatio(str1, str2)
}

Another example: tomato, lemon soup. Python gives 40 as the answer whereas Golang gives 33. Any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant