UNPKG

levenshtein-damerau

Version:

A quick and easy Damerau Levenshtein implementation (not a Levenshtein only operation which doesn't do look aheads or transpositions).

18 lines (13 loc) 324 B
var ld = require("./skodld.js"); console.log("four:fuor",ld("four","fuor")); /* DEBUG */ var showmatrix = 6; console.log("\nfuor:four,debug custom"); ld("fuor","four",function(matrix){ showmatrix--; if(showmatrix == 0){ console.log(matrix); } }); console.log("\nfuor:four,default debug"); ld("fuor","four",1);