2

I have string a s1 = 'abcd' and s2 = 'this is demo abc'

is there library or way to do following fuzzy matching in javascript - I want index of fuzzy matched string , it's size and ratio

Ex.output - index - 13 fuzzy matched string size - 3 ratio - 80%

I searched lot of fuzzy matching libraries in javascript but they usually search in a list of strings and return closest element.

But I want to search string into larger string and get all the details like matched string index,size and matching percentage.

  • 1
    [levenshtein-search](https://github.com/taleinat/levenshtein-search) has most of the features you need. It generates a list of matching substrings, but the list doesn't include the [matching percentages](https://stackoverflow.com/questions/10405440/percentage-rank-of-matches-using-levenshtein-distance-matching). – Anderson Green Nov 13 '22 at 16:32
  • [`fuzzball`](https://www.npmjs.com/package/fuzzball) is probably what you want. – brandonscript Mar 15 '23 at 05:17

0 Answers0