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

fuzz.partial_ratio not working with extract as expected. #47

Open
MatCast opened this issue Feb 1, 2023 · 1 comment
Open

fuzz.partial_ratio not working with extract as expected. #47

MatCast opened this issue Feb 1, 2023 · 1 comment

Comments

@MatCast
Copy link

MatCast commented Feb 1, 2023

Fuzz Partial Ratio:

fuzz.partial_ratio('["12343412142 . Freddies Flowers jasdfoajasjdha DE this is a partial test blue hhgg: 1234567896 jakdlas jaljkdaf 978978777 CRED: 09876556677 hgtf: djalakdhnnhgn7777 abc: uuhhggg", "ljkadsfjkhfadjkh778"] jjhha (Europe) et Cie, S.C.A.'.lower(), 'c&a')

Returns:
33

However

process.extract('["12343412142 . Freddies Flowers jasdfoajasjdha DE this is a partial test blue hgg: 1234567896 jakdlas jaljkdaf 978978777 CRED: 09876556677 hgtf: djalakdhnnhgn7777 abc: uuhhggg", "ljkadsfjkhfadjkh778"] jjhha (Europe) et Cie, S.C.A.'.lower(), ['c&a', 'this is a partial', 'test'], scorer=fuzz.partial_ratio)

Returns:
[('c&a', 100), ('this is a partial', 100), ('test', 100)]

So the returned score for 'c&a' is 33 for fuzz.partial_ratio but 100 when using extract with fuzz.partial_ratio as scorer.

@MatCast
Copy link
Author

MatCast commented Feb 6, 2023

The issue seem to be related to the processor parameter as setting processor=None solves the issue:

process.extract('["12343412142 . Freddies Flowers jasdfoajasjdha DE this is a partial test blue hgg: 1234567896 jakdlas jaljkdaf 978978777 CRED: 09876556677 hgtf: djalakdhnnhgn7777 abc: uuhhggg", "ljkadsfjkhfadjkh778"] jjhha (Europe) et Cie, S.C.A.'.lower(), ['c&a', 'this is a partial', 'test'], scorer=fuzz.partial_ratio, processor=None)

Returns:

[('this is a partial', 100), ('test', 100), ('c&a', 33)]

As expected.

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