Get started with levenshtein CDN
Unlicense licensed
Levenshtein library: Lightweight tool for calculating string edit distance.
Tags:- Levenshtein
- string
Stable version
Copied!
How to start using levenshtein CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with levenshtein CDN - cdnhub.io</title>
<script src="https://cdn.cdnhub.io/levenshtein/1.0.5/levenshtein.min.js"></script>
</head>
<body>
<button onclick="calculateLevenshteinDistance()">Calculate Distance</button>
<p id="result"></p>
<script>
function calculateLevenshteinDistance() {
const string1 = "kitten";
const string2 = "sitting";
const distance = Levenshtein.distance(string1, string2);
document.getElementById("result").innerText = `The Levenshtein distance between "${string1}" and "${string2}" is ${distance}.`;
}
</script>
</body>
</html>
Copied!
Copied!
Copied!