Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 1.03 KB

README.md

File metadata and controls

24 lines (16 loc) · 1.03 KB

Levenshtein

CC BY-SA 3.0 Bitrise Platform Swift version

Calculate the Levenshtein distance between two Strings.

Based on the implementation found at https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance.

Updated for modern (5+) Swift syntax.

Usage

let dog = "Black Russian Terrier"
let cat = "Russian Blue"
Levenshtein.distance(between: dog, and: cat) // 12

License

This implementation of the Levenshtein distance is released under the CC BY-SA 3.0 license. See LICENSE.md for details.