benfdking / textdistance

String comparison library written in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

textdistance

Go Report Card

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

Documentation

The full documentation with further examples is available at GoDoc.

Usage

Install

go get -u github.com/benfdking/textdistance

Example

package main 

import (
    "fmt"

    "github.com/benfdking/textdistance"
)

func main(){
	h := textdistance.NewHamming()
	distance, _ := h.Distance("drummer", "dresser")
	fmt.Println(distance)
}

About

String comparison library written in Go

License:MIT License


Languages

Language:Go 97.4%Language:Makefile 2.6%