String metric functions implemented in Swift.
Currently, following functions are implemented,
distance
: alias ofdistanceJaroWinkler
distanceLevenshtein
: Levenshtein distancedistanceDamerauLevenshtein
: Damerau-Levenshtein distancedistanceHamming
: Hamming distancedistanceMostFreqK
: Most frequent k charactersdistanceNormalizedMostFrequentK
: Normalized most frequent k charactersdistanceJaroWinkler
: Jaro-Winkler distance
For Swift Package Manager
users, add this module as dependency in Package.swift
,
.Package(url: "https://github.com/autozimu/StringMetric.swift.git", majorVersion: 0)
"kitten".distance(between: "sitting") // => 0.746
"君子和而不同".distance(between: "小人同而不和") // => 0.555