Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeLevenshteinDistance ¶ added in v0.0.8
ComputeLevenshteinDistance calculates the Levenshtein distance between two strings. It measures the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into the other.
func Concatenate ¶ added in v0.0.4
func Concatenate[T any](slices ...[]T) []T
Concatenate concatenates multiple slices of type T into a single slice. The function takes a variadic number of slices and returns a new slice containing all elements of the input slices, preserving the order.
func Sum ¶
func Sum[T Number](slice []T) T
Sum calculates the sum of all numbers in the given slice.
func Values ¶
func Values[M ~map[K]V, K comparable, V any](m M) []V
Values extracts the values from a map and returns them as a slice.
Types ¶
type Number ¶
type Number interface { int | uint | int8 | uint8 | int16 | uint16 | int32 | uint32 | int64 | uint64 | float32 | float64 }
Number represents a numeric type that can be used for arithmetic operations. It includes int, uint, int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, and float64.