Class
FuzzyMatcher
ConsoleMonster.Text
Matches and ranks short search patterns against display text.
Inheritance
- object
- FuzzyMatcher
Methods
public static IReadOnlyList<FuzzyResult<T?>> Rank<T>(IEnumerable<T?> items, Func<T?, string> text, string pattern) #Ranks matching items by score, retaining source order for ties.
Type Parameters
- T
- The item type.
Parameters
- items System.Collections.Generic.IEnumerable<T?>
- The source items.
- text System.Func<T?, string>
- Gets searchable text for an item.
- pattern string
- The search pattern.
public static bool TryMatch(string pattern, string text, out FuzzyMatch? match) #Attempts to match a pattern against text.
Parameters
- pattern string
- Terms separated by whitespace.
- text string
- The text to search.
- match ConsoleMonster.Text.FuzzyMatch?
- The score and matched positions when successful.
Returns
bool True when all positive terms match and no exclusion term matches.