Swift Package Index


Tiny Swift implementation of the Levenshtein algorithm


  • The latest stable release is 0.1.0. Released 3 years ago.
  • The last commit to master was 2 years ago.

Swift Version Compatibility

  • 0.1.0
    5.3
    5.2
    5.1
    5.0
    4.2
  • master
    5.3
    5.2
    5.1
    5.0
    4.2
Full build results

Platform Compatibility

  • 0.1.0
    iOS
    macOS(Intel)
    macOS(ARM)
    Linux
    tvOS
    watchOS
  • master
    iOS
    macOS(Intel)
    macOS(ARM)
    Linux
    tvOS
    watchOS
Full build results

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