Skip to content
ConsoleMonster

API Reference

Class

FuzzyMatcher

Namespace ConsoleMonster.Text
Assembly ConsoleMonster
Modifiers static

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) #
Returns: IReadOnlyList<FuzzyResult<T?>>

Ranks matching items by score, retaining source order for ties.

Type Parameters

T
The item type.

Parameters

items System.Collections.Generic.IEnumerable<T?> requiredposition: 0
The source items.
text System.Func<T?, System.String> requiredposition: 1
Gets searchable text for an item.
pattern System.String requiredposition: 2
The search pattern.

Returns

Matching results in rank order.

public static Boolean TryMatch(String pattern, String text, out FuzzyMatch? match) #
Returns: Boolean

Attempts to match a pattern against text.

Parameters

pattern System.String requiredposition: 0
Terms separated by whitespace.
text System.String requiredposition: 1
The text to search.
match ConsoleMonster.Text.FuzzyMatch? requiredposition: 2
The score and matched positions when successful.

Returns

True when all positive terms match and no exclusion term matches.