namespace Producer.Features.Text; public class FuzzyStringSearcher(IEnumerable records, SearchOptions? options = null) : IFuzzySearcher { private readonly IReadOnlyCollection _records = records.ToList(); private readonly SearchOptions _options = options ?? new SearchOptions(); public IReadOnlyCollection> Search(string text) { var dynamicThreshold = (int) Math.Ceiling(text.Length * (_options.Threshold / 100.0)); return Process.ExtractSorted(text, _records, cutoff: dynamicThreshold).ToList(); } }