fuzz.partial_ratio - get some indicator to differentiate between an exact match and a partial match #172
-
@maxbachmann Is it possible to know an exact match (Sentence2) different from a partial match (Sentence1) while using fuzz.partial_ratio? |
Beta Was this translation helpful? Give feedback.
Answered by
maxbachmann
Dec 24, 2021
Replies: 1 comment
-
>>> fuzz.partial_ratio(Query.split(), Sentence1.split())
0.0
>>> fuzz.partial_ratio(Query.split(), Sentence2.split())
100.0 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
maxbachmann
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: