mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Add 'src/modules/launcher/' from commit '28acd466b352a807910cebbc74477d3173b31511'
git-subtree-dir: src/modules/launcher git-subtree-mainline:852689b3dfgit-subtree-split:28acd466b3
This commit is contained in:
32
src/modules/launcher/Wox.Infrastructure/FuzzyMatcher.cs
Normal file
32
src/modules/launcher/Wox.Infrastructure/FuzzyMatcher.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
|
||||
namespace Wox.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user