Say I had a reference string
"abcdabcd"
and a target string
"abcdabEd"
Is there a simple way in javascript and python to get the string sequence similarity ratio?
Example:
"abcdabcd" differs from "abcdabEd" by the character "E" so the ratio of similarity is high but less than 1.0
"bcdabcda" differs from "abcdabEd" greatly because every character at a specific string index is different so the similarity ratio is 0.0
note that the similarity ratio is not how many similar characters are in each string but how similar the sequences are from each other
therefore code like
# python - incorrect for this problem
difflib.SequenceMatcher(None, "bcdabcda", "abcdabEd").ratio()
would be wrong