For example,
a = 'OrangeApple'
and b = 'AppleOrange'
, after running SequenceMatcher(None, a, b).ratio()
the returned ratio (similarity score) is 0.54.
If a = 'OrangeApple'
and b = 'OrangeApple'
the returned ratio is, as expected, 1.
I somehow understand why this happens after reading How does Pythons SequenceMatcher work?, but still not sure how to solve this issue to obtain a ratio equal to 1 in both cases. Any ideas?