Skip to content

How to get a score of 100 #164

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

You must be logged in to vote

The underlying algorithms in rapidfuzz.fuzz come from fuzzywuzzy/thefuzz.

fuzz.partial_ratio

fuzz.partial_ratio simply searches for the alignment with the highest fuzz.ratio. So e.g. for the strings ab<-> abcd it will calculate the fuzz.ratio for the following alignments:

ab <-> a
ab <-> ab
ab <-> bc
ab <-> cd
ab <-> d

and return the highest similarity. In this case 100 for the alignment ab <-> ab.

fuzz.token_sort_ratio / fuzz.partial_token_sort_ratio

Sorts the words in the string and then calculates the fuzz.ratio/fuzz.partial_ratio of the sorted string.

fuzz.token_set_ratio / fuzz.partial_token_set_ratio

Splits the strings into words. Afterwards it creates three lists

  • unique1 holds wo…

Replies: 2 comments 1 reply

This comment was marked as off-topic.

Comment options

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

Answer selected by samayala22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #160 on November 23, 2021 11:25.