Skip to content

fuzz.partial_ratio - get some indicator to differentiate between an exact match and a partial match #172

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

You must be logged in to vote

fuzz.partial_ratio does not allow differentiating an exact match of a word from a partial match. It is however possible to split the sentences into words before matching:

>>> fuzz.partial_ratio(Query.split(), Sentence1.split())
0.0
>>> fuzz.partial_ratio(Query.split(), Sentence2.split())
100.0

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by maxbachmann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #171 on December 28, 2021 12:49.