pair-distance

1.1.0 • Public • Published

Pair distance

This package provides a simple function to calculate similarity between two strings it is based this ruby gem amatch and this article.

The function returns a value between 0 and 1, when 0 been strings completely different and 1 when they are equal.

The result from this package may have a very small difference from the amatch gem in some cases, but in my tests the difference is irrelevant since it was less than 0.05.

Usage

const pairDistance = require("pair-distance");
const similarity = pairDistance("James Bond", "Bond, James Bond")
console.log(similarity); // prints: 0.9411764705882353

CHANGELOG

-1.1.0: Ignoring diacritics -1.0.0: First commit

Readme

Keywords

Package Sidebar

Install

npm i pair-distance

Weekly Downloads

9

Version

1.1.0

License

MIT

Last publish

Collaborators

  • erickzanardo