Provides fuzzy string searching and matching capabilities.
The fuzzy search algorithm is designed to find target strings which mostly match a query string while allowing for breaks, typos, and out of order matches.
[codeblocks]
[gdscript]
var items := ["Potion of Healing", "Greater Health Potion", "Poison Vial"]
var fuzzy := FuzzySearch.new()
for result in fuzzy.search_all("health potion", items):
# Prints "Greater Health Potion", "Potion of Healing"
print(result.target)
[/gdscript]
[csharp]
string[] items = ["Potion of Healing", "Greater Health Potion", "Poison Vial"];
FuzzySearch fuzzy = new();
foreach (var result in fuzzy.SearchAll("health potion", items))
{
// Prints "Greater Health Potion", "Potion of Healing"
GD.Print(result.Target);
}
[/csharp]
[/codeblocks]
Searches the [param target] for [param query], returning a [FuzzySearchMatch] instance on success or [code]null[/code] otherwise.
Searches all of [param targets] for [param query] and returns up to the top [member max_results] scoring values. The results are sorted by score in descending order. Low quality results are removed if [member filter_low_scores] is [code]true[/code].
Whether the query character casing should be matched exactly or not.
Minimum score for filtering results returned by [method search_all].
Biases the filtering cutoff score between the average score and max score. Value should be between [code]0[/code] and [code]1[/code].
If [code]true[/code], lower quality matches are not returned by [method search_all]. The default filtering behavior is tuned to keep exact matches and reject significantly broken up matches. Setting this to [code]false[/code] can potentially improve results when searching a small number of items.
Maximum number of non-matched characters in the query before skipping a target as non-matching. This option is ignored if [member use_exact_tokens] is [code]true[/code].
Maximum number of results which can be returned by [method search_all].
Number of leading characters to omit from matching. For example, this can be used to skip a common prefix such as [code]res://[/code].
If [code]true[/code], only targets which contain each token as a non-overlapping substring are returned. Gaps and missed characters are not considered valid matches, but [member case_sensitive] is still used.