mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Update scoring for all substrings contained in compare string
This commit is contained in:
parent
78a2086535
commit
b54241a5b2
1 changed files with 3 additions and 5 deletions
|
|
@ -192,7 +192,7 @@ namespace Wox.Infrastructure
|
|||
return currentQuerySubstringIndex >= querySubstringsLength;
|
||||
}
|
||||
|
||||
private static int CalculateSearchScore(string query, string stringToCompare, int firstIndex, int matchLen, bool allWordsFullyMatched)
|
||||
private static int CalculateSearchScore(string query, string stringToCompare, int firstIndex, int matchLen, bool allSubstringsContainedInCompareString)
|
||||
{
|
||||
// A match found near the beginning of a string is scored more than a match found near the end
|
||||
// A match is scored more if the characters in the patterns are closer to each other,
|
||||
|
|
@ -209,10 +209,8 @@ namespace Wox.Infrastructure
|
|||
score += 10;
|
||||
}
|
||||
|
||||
if (allWordsFullyMatched)
|
||||
{
|
||||
score += 20;
|
||||
}
|
||||
if (allSubstringsContainedInCompareString)
|
||||
score += 10 * string.Concat(query.Where(c => !char.IsWhiteSpace(c))).Count();
|
||||
|
||||
return score;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue