The library provides several ways to perform fuzzy searches against a list of strings (strList) using a target string (str).
1. Most matching unique result (no threshold)
Use FuzzySearch(str, strList, algorithm) to find the single best match.
2. Most matching unique result (with threshold)
Use FuzzySearchThreshold(str, strList, minSimilarity, algorithm) to find the best match only if its similarity is at least minSimilarity (e.g., 0.7).
3. Most matching result set (no threshold)
Use FuzzySearchSet(str, strList, resultQuantity, algorithm) to return a slice of the top resultQuantity matches.
4. Most matching result set (with threshold)
Use FuzzySearchSetThreshold(str, strList, resultQuantity, minSimilarity, algorithm) to return up to resultQuantity matches that meet the minSimilarity requirement.
// Example: Most matching unique result with threshold
strList := []string{"test", "tester", "tests", "testers", "testing", "tsting", "sting"}
res, err := edlib.FuzzySearchThreshold("testnig", strList, 0.7, edlib.Levenshtein)
if err != nil {
fmt.Println(err)
} else {
fmt.Printf("Result: %s", res)
}