Levenshtein

master

Tiny Swift implementation of the Levenshtein algorithm
decryptOS/Levenshtein

Levenshtein

Tiny Swift implementation of the Levenshtein algorithm

Installation

Swift Package Manager

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),
        // ...
    ]
)

Usage

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

Description

  • Swift Tools 4.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Oct 18 2024 07:43:26 GMT-0900 (Hawaii-Aleutian Daylight Time)