chapman-length-deviation
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Chapman Length Deviation

The Chapman Length Deviation algorithm implementation

  • Used to determine if the strings are similar in size
  • This apporach should be used alongside other approaches eg. Jaro, Jaro-winkler, Levenshtein...

Install

npm install -S chapman-length-deviation

Usage

import deviation from "chapman-length-deviation";

deviation('Hello', 'Hallo');
// 1

deviation('HELLO', 'Hallo');
// 1

deviation('Hello', 'Hello World');
// 0.45454545454545453


// Return Percentage

deviation('Hello', 'Hallo', {returnPercentage : true});
// 100

deviation('Hello', 'Hello World', {returnPercentage : true});
// 45.45454545454545

Package Sidebar

Install

npm i chapman-length-deviation

Weekly Downloads

3

Version

1.0.4

License

MIT

Unpacked Size

5.65 kB

Total Files

12

Last publish

Collaborators

  • kwunshing