/strmet

Fast string metric algorithms written in go

Primary LanguageGoMIT LicenseMIT

strmet

GoDoc Build Status Go Report Card

Fast and memory efficient string metric algorithms.

Available algorithms:

Example

package main

import (
    "fmt"
    "github.com/eskriett/strmet"
)

func main() {
    s1 := "baseball"
    s2 := "football"

    fmt.Printf("The Levenshtein distance between %s and %s is %d\n",
        s1, s2, strmet.Levenshtein(s1, s2, 10))
	// -> The Levenshtein distance between baseball and football is 4

    s1 = "salt"
    s2 = "slat"
    fmt.Printf("The Damerau–Levenshtein distance between %s and %s is %d\n",
        s1, s2, strmet.DamerauLevenshtein(s1, s2, 10))
	// -> The Damerau–Levenshtein distance between salt and slat is 1
}