seatgeek / fuzzywuzzy

Fuzzy String Matching in Python
http://chairnerd.seatgeek.com/fuzzywuzzy-fuzzy-string-matching-in-python/
GNU General Public License v2.0
9.23k stars 876 forks source link

Token sort ratio is not a commutative operator #205

Closed CMCDragonkai closed 6 years ago

CMCDragonkai commented 6 years ago

I was hoping to use this operator in a BKTree (https://github.com/Jetsetter/pybktree), but I found this happening.

fuzz.token_sort_ratio('sma solar technology ag', 'Sungrow Power Supply Co Ltd') # 24
fuzz.token_sort_ratio( 'Sungrow Power Supply Co Ltd', 'sma solar technology ag') # 28
CMCDragonkai commented 6 years ago

Just found this issue: https://github.com/seatgeek/fuzzywuzzy/issues/173 I will test with the C library.

CMCDragonkai commented 6 years ago

With the installation of pip install python-levenshtein, this problem goes away.