Skip to content

sc0Vu/didyoumean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

didyoumean

Go Go Report Card

Didyoumean written in golang, find the similar string from the given string list. Currently it use Levenshtein distance to calculate edit distannce between two strings. See: https://en.wikipedia.org/wiki/Levenshtein_distance

Installation

$ go get https://github.com/sc0vu/didyoumean

or you can

import (
    "https://github.com/sc0vu/didyoumean"
)

Usage

Parameters

ThresholdRate float64

ThresholdRate is the rate that allows the edit distanse less than, eg 0.4 means the edit distance less than 40%

CaseInsensitive bool

CaseInsensitive compare the edit distance in case insensitive mode

FirstMatch

Find first match of the given string list

didyoumean.FirstMatch("key", []string{"kkk", "apple", "kea"})

Match

Find all match of the given string list

didyoumean.Match("key", []string{"kkk", "apple", "kea"})

License

MIT

About

Didyoumean in golang (Levenshtein distance)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published