sum-best-match
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

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.

Package Sidebar

Install

npm i sum-best-match

Weekly Downloads

2

Version

1.2.1

License

MIT

Unpacked Size

55.4 kB

Total Files

5

Last publish

Collaborators

  • natqe3