levenshtein

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package levenshtein includes the levenshtein distance algorithm plus additional helper functions. The algorithm is taken from https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distance

func Distance(a, b string, caseSensitive bool) int

Distance returns the Levenshtein distance.

func MinString added in v1.6.7

func MinString[S ~[]E, E any](x S, fn func(a E) string, s string, caseSensitive bool) (rv string)

MinString returns the string attribute determined by fn out of x with the minimal Levenshtein distance to s.

Types

This section is empty.

Jump to

Keyboard shortcuts

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