ld

package
Version: v0.0.0-...-d647f49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2021 License: Unlicense Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EditDistance

func EditDistance(s, t string) int

The edit distances here is actually Levenshtein distance, minimum number of single-character edits (insertions, deletions or substitutions) required to change one string into the other.

func LevenshteinDistance

func LevenshteinDistance(s, t string) int

func Recursive

func Recursive(s []rune, lenS int, t []rune, lenT int) int

lenS and lenT are the number of characters in string s and t respectively

func StringToRuneSlice

func StringToRuneSlice(s string) []rune

Types

type BKNode

type BKNode struct {
	Str      string
	Children map[int]*BKNode
}

type BKTree

type BKTree struct {
	DistanceFunc func(string, string) int
	// contains filtered or unexported fields
}

func NewBKTree

func NewBKTree() *BKTree

func (*BKTree) Add

func (b *BKTree) Add(s string)

func (*BKTree) Search

func (b *BKTree) Search(s string, radius int) []*BKNode

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL