textdistance
is a string comparison library written in Go. Heavily inspired by the identically named Python library, it aims to provide a myriad of different algorithms.
Additionally, it aims to be:
- safe for production use, preferring
error
where required over absolute raw performance - have consistent interfaces in order to test different implementations to enable easy dependency injection
- within those constraints being as performant as possible: allowing assembly snippets but no
C
library links
The full documentation with further examples is available at GoDoc.
go get -u github.com/benfdking/textdistance
package main
import (
"fmt"
"github.com/benfdking/textdistance"
)
func main(){
h := textdistance.NewHamming()
distance, _ := h.Distance("drummer", "dresser")
fmt.Println(distance)
}