Repository
Current version released
5 years ago
Versions
eddist-deno
String edit distance calculation module for Deno. The edit distance is the minimum number of changes needed to turn string A into string B.
This module is functional but basic, it does not provide memory optimizations (yet).
Usage
As an example, to change the word kitten to sitting the following steps are needed:
- (sub k to s): sitten
- (sub e to i): sittin
- (add g): sitting
2 substitutions and 1 addition make the edit distance 2 + 1 = 3.
import { eddist } from "https://deno.land/x/eddist@v0.1.0/mod.ts"
const dist = eddist('kitten', 'sitting');
console.log(dist); // logs 3