Update Program plugin with new code

This commit is contained in:
Jeremy Wu
2019-09-29 15:03:30 +10:00
parent acd42f9cc6
commit cc23495591
3 changed files with 21 additions and 10 deletions

View File

@@ -240,9 +240,9 @@ namespace Wox.Plugin.Program.Programs
private int Score(string query)
{
var score1 = StringMatcher.Score(DisplayName, query);
var score1 = StringMatcher.FuzzySearch(query, DisplayName).ScoreAfterSearchPrecisionFilter();
var score2 = StringMatcher.ScoreForPinyin(DisplayName, query);
var score3 = StringMatcher.Score(Description, query);
var score3 = StringMatcher.FuzzySearch(query, Description).ScoreAfterSearchPrecisionFilter();
var score4 = StringMatcher.ScoreForPinyin(Description, query);
var score = new[] { score1, score2, score3, score4 }.Max();
return score;

View File

@@ -31,11 +31,11 @@ namespace Wox.Plugin.Program.Programs
private int Score(string query)
{
var score1 = StringMatcher.Score(Name, query);
var score1 = StringMatcher.FuzzySearch(query, Name).ScoreAfterSearchPrecisionFilter();
var score2 = StringMatcher.ScoreForPinyin(Name, query);
var score3 = StringMatcher.Score(Description, query);
var score3 = StringMatcher.FuzzySearch(query, Description).ScoreAfterSearchPrecisionFilter();
var score4 = StringMatcher.ScoreForPinyin(Description, query);
var score5 = StringMatcher.Score(ExecutableName, query);
var score5 = StringMatcher.FuzzySearch(query, ExecutableName).ScoreAfterSearchPrecisionFilter();
var score = new[] { score1, score2, score3, score4, score5 }.Max();
return score;
}