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

Addition of WRatio #9

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Addition of WRatio #9

wants to merge 5 commits into from

Conversation

guwidoe
Copy link

@guwidoe guwidoe commented Dec 9, 2024

This PR attempts the addition of all functionality required for the addition of WRatio which includes:

  • token_ratio
  • partial_ratio
  • partial_token_ratio
  • wratio
  • and some lower-level dependencies of these functions.

Additionally, lots of test cases were added. (Many of which don't pass yet (Sometimes the tests themself make wrong assumptions, but they are a good base for further debugging.)

This PR should not be merged yet.

One major issue is that, because the ratio function returns in the range from 0-1 and the other newly implemented ratio functions return between 0-100, like in the C++ implementation, hence the score_cutoff parameter doesn't work properly yet.

However, with score_cutoff set to 0, the functions seem to return the same values as in the C++ reference implementation.

I have opened this PR because I'm not sure if I will have time to further work on this - I think the current, very sloppy state of the implementation in this PR is already sufficient for my use case for now.

@maxbachmann
Copy link
Member

@ljnsn is currently looking into porting the remaining functions as well, so this could help him.

The partial_ratio implementation here appears to mistakenly implement the token_ratio instead.

@guwidoe
Copy link
Author

guwidoe commented Dec 12, 2024

Thanks for the hint, I will look into it as soon as I have time!

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

Successfully merging this pull request may close these issues.

2 participants