fuzzy

package
v0.0.0-...-52a80d5 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Score

func Score(needle, haystack string) float64

Returns: -1 if the needle contains letters the haystack does not contain, or if the needle length exceeds the haystack length.

0 if no similarities were found

> 0 based on similarities between the needle and haystack (increasing)

func ScoreAndSortChannels

func ScoreAndSortChannels(searchTerm string, searchables []*discordgo.Channel) []*discordgo.Channel

func ScoreAndSortEmoji

func ScoreAndSortEmoji(searchTerm string, unicodeEmoji []string, customEmoji []*discordgo.Emoji) []string

func ScoreAndSortMembers

func ScoreAndSortMembers(searchTerm string, searchables []*discordgo.Member) []*discordgo.Member

func ScoreAndSortRoles

func ScoreAndSortRoles(searchTerm string, searchables []*discordgo.Role) []*discordgo.Role

func ScoreAndSortUsers

func ScoreAndSortUsers(searchTerm string, searchables []*discordgo.User) []*discordgo.User

func ScoreSearch

func ScoreSearch(searchTerm string, searchItems []string) map[string]float64

Types

type SearchResult

type SearchResult struct {
	Key   string
	Value float64
}

func SortSearchResults

func SortSearchResults(results map[string]float64) []SearchResult

Jump to

Keyboard shortcuts

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