npm.io
3.0.0 • Published 6 years ago

sorted-edit-distance

Licence
MIT
Version
3.0.0
Deps
0
Size
3 kB
Vulns
0
Weekly
0
Stars
1

sorted-edit-distance

This tool can be used to improve edit-distance checks for strings by sorting the strings and then running the edit-distance algorithm.

eg.

Previous String A = dark apple eat
Previous String B = eat dark apple

# Now these strings will be sorted first :

New String A = apple dark eat
New String B = apple dark eat

Usage

const { sortedEditDistance, editDistance } = require('sorted-edit-distance');

const A = 'dark apple eat';
const B = 'eat dark apple';

const editDistance1 = sortedEditDistance(A, B);
const editDistance2 = editDistance(A, B);

Keywords