fuzzywuzzy
fuzzywuzzy copied to clipboard
Partial Ratio Force Partial of 2nd Argument Only
Consider this example: fuzz.partial_ratio("An Act of Wisdom - In Theatres", "Theatres") => 100%
The result would be misleading. What's the best way to handle this and still leverage the benefits of partial_ratio for the longer strings?
As I said in the other issue:
I'm not implementing that in fuzzywuzzy, but you are free to do so in a wrapper function by just checking if one string is in another. Note that you'll definitely incur a performance penalty.
Note: it technically shouldn't matter as we're swapping the shorter/longer strings here: https://github.com/seatgeek/fuzzywuzzy/blob/master/fuzzywuzzy/fuzz.py#L61-L66