Tiny Swift implementation of the Levenshtein algorithm
To use this package with the Swift Package Manager you include this repository in your Package.swift
file:
import PackageDescription
let package = Package(
// ...
dependencies: [
// ...
.Package(url: "https://github.com/decryptOS/Levenshtein.git", majorVersion: 0, minor: 1),
// ...
]
)
import Levenshtein
// ...
let a = "Apple"
let b = "Apples"
assert(levenshteinDistance(a, b) == 1)
// 1 because 1 change is necessary to transform between a and b