Skip to content

Conversation

@TimpiaAI
Copy link

@TimpiaAI TimpiaAI commented Jan 3, 2026

Summary

  • Adds scorer parameter to partial_ratio and downstream functions
  • Supports indel (default) and levenshtein
  • Backward compatible

Usage

fuzz.partial_ratio(a, c, scorer="levenshtein")  # 50.0

Test plan

  • All 166 existing tests pass
  • 11 new tests added

Closes #401

  Add a scorer parameter to partial_ratio and downstream functions
  that allows choosing between indel (default) and levenshtein.

  - Default is indel for backward compatibility
  - C++ uses optimized path for indel, falls back to Python for levenshtein
  - Adds 11 new tests for the scorer parameter

  Closes rapidfuzz/RapidFuzz#rapidfuzz#401
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.

Could partial_ratio support Levenshtein.normalized_similarity?

1 participant