Last active
February 27, 2019 06:50
-
-
Save camelcaseblog/06e952c433ab98696061002495f68fdc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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