mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Port StringMatcher.FuzzySearch to IPublicAPI
This commit is contained in:
parent
2608d961d0
commit
b67f5de4c5
2 changed files with 9 additions and 0 deletions
|
|
@ -88,5 +88,7 @@ namespace Flow.Launcher.Plugin
|
|||
/// if you want to hook something like Ctrl+R, you should use this event
|
||||
/// </summary>
|
||||
event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
|
||||
|
||||
public (List<int> MatchedData, int Score, bool Success) MatchString(string query, string stringToCompare);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,6 +132,12 @@ namespace Flow.Launcher
|
|||
|
||||
public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
|
||||
|
||||
public (List<int> MatchedData, int Score, bool Success) MatchString(string query, string stringToCompare)
|
||||
{
|
||||
var result = StringMatcher.FuzzySearch(query, stringToCompare);
|
||||
return (result.MatchData, result.Score, result.Success);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
|
|
@ -144,6 +150,7 @@ namespace Flow.Launcher
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue