Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 741 Bytes

README.md

File metadata and controls

31 lines (22 loc) · 741 Bytes

edit_dist

A simple package that provides two functions that will compute the minimum edit distance, and weighted edit distance between two strings.

This algorithm currently uses Levenshtein distance which counts the operation of substitution as 2. More info on minimum edit distance can be found here

Usage

import (
    "fmt"
    edit "go-edit"
)

func main() {
    str1 := "Hello"
    str2 := "World"

    dist := edit.MinEditDistance(str1, str2)

    fmt.Printf("Edit distance between %s and %s: %d", str1, str2, dist)
}

Contribution

If you see a typo or perhaps something that could be improved upon, feel free to fork the project modify and submit a pull request.