sorted-edit-distance
v3.0.0
Published
Sort strings based on spaces in string and then run edit distance to decrease false negatives.
Downloads
1
Readme
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);