15,6 → 15,34 |
return proche; |
} |
|
// http://stackoverflow.com/questions/1960473/unique-values-in-an-array |
function getUnique(tableau) { |
var u = {}, a = []; |
for(var i = 0, l = tableau.length; i < l; ++i){ |
if(u.hasOwnProperty(tableau[i])) { |
continue; |
} |
a.push(tableau[i]); |
u[tableau[i]] = 1; |
} |
return a; |
} |
|
// http://stackoverflow.com/questions/281264/remove-empty-elements-from-an-array-in-javascript |
function clean(tableau, deleteValue) { |
for (var i = 0; i < tableau.length; i++) { |
if (tableau[i] == deleteValue) { |
tableau.splice(i, 1); |
i--; |
} |
} |
return tableau; |
} |
|
function trim(myString) { |
return myString.replace(/^\s+/g,'').replace(/\s+$/g,'') |
} |
|
function levenshtein (s1, s2) { |
// http://kevin.vanzonneveld.net |
// + original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com) |
85,3 → 113,4 |
} |
return v0[s1_len]; |
} |
|