Skip to content

Instantly share code, notes, and snippets.

Embed
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
You can’t perform that action at this time.