Skip to content

docs: recover matching substrings from extracted choices - #500

Open
ac1982 wants to merge 1 commit into
rapidfuzz:mainfrom
ac1982:docs/extract-matching-substrings
Open

ac1982 wants to merge 1 commit into
rapidfuzz:mainfrom
ac1982:docs/extract-matching-substrings

Conversation

@ac1982

@ac1982 ac1982 commented Oct 16, 2026

Copy link
Copy Markdown

Show how to recover matching substrings from process.extract results using fuzz.partial_ratio_alignment on the selected choices (#394). The example keeps the native implementation, uses the same partial-ratio scorer in both steps, and preserves mapping keys.

Explain which ranges belong to the query and choice, why this does not describe arbitrary scorers such as WRatio, and why offsets from processed strings cannot generally slice the originals. This is a recipe using existing APIs; it does not change the result tuple or avoid the second alignment calculation.

Validation on Python 3.12/Linux arm64: built native extensions from this checkout, all 421 tests pass, exact doctests pass in native and Python modes, additional checks cover mapping/list inputs, Unicode, empty/no-match inputs, long/short queries, and normalization offsets. Sphinx builds with warnings as errors; all applicable changed-file pre-commit checks pass.

AI-assisted contribution, investigated and validated with Codex.

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