Skip to content

Accept exact partial-ratio cutoffs in the Python backend - #516

Open
AryanRG wants to merge 1 commit into
rapidfuzz:mainfrom
AryanRG:fix/python-partial-ratio-cutoff
Open

AryanRG wants to merge 1 commit into
rapidfuzz:mainfrom
AryanRG:fix/python-partial-ratio-cutoff

Conversation

@AryanRG

@AryanRG AryanRG commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

The Python implementations of partial_ratio() and partial_ratio_alignment() can reject a nonempty match exactly at score_cutoff. Scaling the cutoff to the internal score range can round it above the matching score.

Round the internal cutoff down by one representable step and still compare the final score against the original cutoff.

All 179 fuzz tests passed. The broader suite reproduced the same four pre-existing failures on base and patch. Black and Ruff passed on the changed files.

This branch has not been deployed

No deployments
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.

1 participant