Skip to content

Instantly share code, notes, and snippets.

View wagnerand's full-sized avatar

Andreas Wagner wagnerand

View GitHub Profile
@wagnerand
wagnerand / gist:5466500
Created April 26, 2013 11:13
Levenshtein on Firefox tags!
function levenshtein(s1, s2) {
var i, j, cost, v0, v1, v_tmp, a, b, c,
L1 = s1.length,
L2 = s2.length;
if (L1 === 0) {
return L2;
} else if (L2 === 0) {
return L1;
} else if (s1 === s2) {