项目作者: benfdking

项目描述 :
String comparison library written in Go
高级语言: Go
项目地址: git://github.com/benfdking/textdistance.git
创建时间: 2020-02-08T13:41:57Z
项目社区:https://github.com/benfdking/textdistance

开源协议:MIT License

下载


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

  1. go get -u github.com/benfdking/textdistance

Example

  1. package main
  2. import (
  3. "fmt"
  4. "github.com/benfdking/textdistance"
  5. )
  6. func main(){
  7. h := textdistance.NewHamming()
  8. distance, _ := h.Distance("drummer", "dresser")
  9. fmt.Println(distance)
  10. }