From e60797cd0f55d5566c54bb755dd3c998633f7b33 Mon Sep 17 00:00:00 2001 From: SysC0mp Date: Mon, 9 Dec 2019 21:06:31 +0100 Subject: [PATCH] Introduce RawScore property New property RawScore is used to save the calculated score without any search precision filtering added. --- Wox.Infrastructure/StringMatcher.cs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Wox.Infrastructure/StringMatcher.cs b/Wox.Infrastructure/StringMatcher.cs index baca1020f2..f350e0e404 100644 --- a/Wox.Infrastructure/StringMatcher.cs +++ b/Wox.Infrastructure/StringMatcher.cs @@ -96,7 +96,7 @@ namespace Wox.Infrastructure { Success = true, MatchData = indexList, - Score = Math.Max(score, pinyinScore) + RawScore = Math.Max(score, pinyinScore) }; return result.Score > 0 ? @@ -171,16 +171,22 @@ namespace Wox.Infrastructure { public bool Success { get; set; } - private int _score; - public int Score + /// + /// The final score of the match result with all search precision filters applied. + /// + public int Score { get; private set; } + + /// + /// The raw calculated search score without any search precision filtering applied. + /// + private int _rawScore; + public int RawScore { - get - { - return _score; - } + get { return _rawScore; } set { - _score = ApplySearchPrecisionFilter(value); + _rawScore = value; + Score = ApplySearchPrecisionFilter(_rawScore); } }