Skip to content

Instantly share code, notes, and snippets.

Last active February 27, 2019 06:50
What would you like to do?
const levenshtein = require("js-levenshtein")
const normalizedLevenshtein = (a, b) => levenshtein(a, b) / Math.max(a.length, b.length)
console.log(normalizedLevenshtein("headphones", "headph0nes"))
// 0.1
console.log(normalizedLevenshtein("לימון", "לימונים"))
// 0.42857142857142855
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment