sum-best-match

get sum of best match for the given strings

Usage no npm install needed!

<script type="module">
  import sumBestMatch from 'https://cdn.skypack.dev/sum-best-match';
</script>

README

sumBestMatch

get sum of best match for the given strings

Usage: sumBestMatch(mainStrings: string[], targetStrings: string[]): { bestMatch: { target: string, rating: number }, ratings: Array<{ target: string, rating: number }> }

import { sumBestMatch } from 'sum-best-match'

sumBestMatch(['one', 'one two', 'one two three'], ['one', 'two', 'three'])
// Output: {
//     bestMatch: { target: 'one', rating: 0.6888888888888888 },
//     ratings: [
//       { target: 'one', rating: 0.6888888888888888 },
//       { target: 'two', rating: 0.35555555555555557 },
//       { target: 'three', rating: 0.2222222222222222 }
//     ]
//   }

This module exported from utilizes project.