Version: v0.0.0-...-7e2ab92 Latest Latest Go to latest
Published: May 2, 2015 License: Apache-2.0

## README ¶

### Levenshtein Distance

Go package to calculate the Levenshtein Distance

#### Install

``````go get github.com/arbovm/levenshtein
``````

#### Example

``````package main

import (
"fmt"
"github.com/arbovm/levenshtein"
)

func main() {
s1 := "kitten"
s2 := "sitting"
fmt.Printf("The distance between %v and %v is %v\n",
s1, s2, levenshtein.Distance(s1, s2))
// -> The distance between kitten and sitting is 3
}

``````

Located here

## Documentation ¶

### Constants ¶

This section is empty.

### Variables ¶

This section is empty.

### Functions ¶

#### func Distance ¶

`func Distance(s1, s2 string) int`

The Levenshtein distance between two strings is defined as the minimum number of edits needed to transform one string into the other, with the allowable edit operations being insertion, deletion, or substitution of a single character http://en.wikipedia.org/wiki/Levenshtein_distance

This implemention is optimized to use O(min(m,n)) space. It is based on the optimized C version found here: http://en.wikibooks.org/wiki/Algorithm_implementation/Strings/Levenshtein_distance#C

### Types ¶

This section is empty.
{"ft_lang_label":"__label__en","ft_lang_prob":0.78892237,"math_prob":0.78018165,"size":1039,"snap":"2021-43-2021-49","text_gpt3_token_len":265,"char_repetition_ratio":0.14299516,"word_repetition_ratio":0.02189781,"special_character_ratio":0.21559192,"punctuation_ratio":0.14124294,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9536502,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-11-30T21:56:20Z\",\"WARC-Record-ID\":\"<urn:uuid:6e3853d2-fea4-4764-b045-7b9dc662bfd5>\",\"Content-Length\":\"35620\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:dccb7e4d-c84d-4cc5-8249-6bc72d275d7a>\",\"WARC-Concurrent-To\":\"<urn:uuid:83ef1a94-a504-4f6f-a3e9-1051fd0ee3d2>\",\"WARC-IP-Address\":\"34.149.140.181\",\"WARC-Target-URI\":\"https://pkg.go.dev/github.com/xchapter7x/systee@v0.0.0-20150502181708-7e2ab92a304e/Godeps/_workspace/src/github.com/arbovm/levenshtein\",\"WARC-Payload-Digest\":\"sha1:XDQU34B2LBXSILEOV5GYCLXYE5CNLREO\",\"WARC-Block-Digest\":\"sha1:GPHI6KQLXCAZWLRWG6QBPAYUOA3WJ2ZI\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-49/CC-MAIN-2021-49_segments_1637964359073.63_warc_CC-MAIN-20211130201935-20211130231935-00060.warc.gz\"}"}