Skip to content

Why do scorers return a different result than process.extract #165

Closed Answered by maxbachmann
maxbachmann asked this question in Q&A
Discussion options

You must be logged in to vote

process.extract preprocesses strings by default (see https://maxbachmann.github.io/RapidFuzz/process.html#extract)

processor (Callable, optional) – Optional callable that reformats the strings. utils.default_process is used by default, which lowercases the strings and trims whitespace

You can disable this behavior by passing processor=None:

process.extract('atk!', x, scorer=fuzz.ratio, processor=None)

or enable it for scorers by passing processor=utils.default_process:

fuzz.ratio('atk', 'atk%', processor=utils.default_process)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by maxbachmann
Comment options

You must be logged in to vote
1 reply
@maxbachmann
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants