mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
Update browserbookmark plugin with new code
This commit is contained in:
@@ -62,9 +62,9 @@ namespace Wox.Plugin.BrowserBookmark
|
|||||||
|
|
||||||
private bool MatchProgram(Bookmark bookmark, string queryString)
|
private bool MatchProgram(Bookmark bookmark, string queryString)
|
||||||
{
|
{
|
||||||
if ((bookmark.Score = StringMatcher.FuzzySearch(queryString, bookmark.Name, new MatchOption()).Score) > 0) return true;
|
if (StringMatcher.FuzzySearch(queryString, bookmark.Name, new MatchOption()).IsSearchPrecisionScoreMet()) return true;
|
||||||
if ((bookmark.Score = StringMatcher.FuzzySearch(queryString, bookmark.PinyinName, new MatchOption).Score) > 0) return true;
|
if ( StringMatcher.FuzzySearch(queryString, bookmark.PinyinName, new MatchOption()).IsSearchPrecisionScoreMet()) return true;
|
||||||
if ((bookmark.Score = StringMatcher.FuzzySearch(queryString, bookmark.Url, new MatchOption()).Score / 10) > 0) return true;
|
if (StringMatcher.FuzzySearch(queryString, bookmark.Url, new MatchOption()).IsSearchPrecisionScoreMet()) return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ namespace Wox.Infrastructure
|
|||||||
return score;
|
return score;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsPreciciseMatch(this MatchResult matchResult)
|
public static bool IsSearchPrecisionScoreMet(this MatchResult matchResult)
|
||||||
{
|
{
|
||||||
var precisionScore = (SearchPrecisionScore)Enum.Parse(typeof(SearchPrecisionScore),
|
var precisionScore = (SearchPrecisionScore)Enum.Parse(typeof(SearchPrecisionScore),
|
||||||
UserSettingSearchPrecision ?? SearchPrecisionScore.Regular.ToString());
|
UserSettingSearchPrecision ?? SearchPrecisionScore.Regular.ToString());
|
||||||
|
|||||||
Reference in New Issue
Block a user