mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
32 lines
859 B
C#
32 lines
859 B
C#
using System;
|
|
|
|
namespace Flow.Launcher.Infrastructure
|
|
{
|
|
[Obsolete("This class is obsolete and should not be used. Please use the static function StringMatcher.FuzzySearch")]
|
|
public class FuzzyMatcher
|
|
{
|
|
private string query;
|
|
private MatchOption opt;
|
|
|
|
private FuzzyMatcher(string query, MatchOption opt)
|
|
{
|
|
this.query = query.Trim();
|
|
this.opt = opt;
|
|
}
|
|
|
|
public static FuzzyMatcher Create(string query)
|
|
{
|
|
return new FuzzyMatcher(query, new MatchOption());
|
|
}
|
|
|
|
public static FuzzyMatcher Create(string query, MatchOption opt)
|
|
{
|
|
return new FuzzyMatcher(query, opt);
|
|
}
|
|
|
|
public MatchResult Evaluate(string str)
|
|
{
|
|
return StringMatcher.Instance.FuzzyMatch(query, str, opt);
|
|
}
|
|
}
|
|
}
|