didyoumean

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NameSuggestion

func NameSuggestion(given string, suggestions []string) string

NameSuggestion tries to find a name from the given slice of suggested names that is close to the given name and returns it if found. If no suggestion is close enough, returns the empty string.

The suggestions are tried in order, so earlier suggestions take precedence if the given string is similar to two or more suggestions.

This function is intended to be used with a relatively-small number of suggestions. It's not optimized for hundreds or thousands of them.

Types

This section is empty.

Jump to

Keyboard shortcuts

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