From 04b0f8b2a4cbfb427a9b8067ebacf11e03204511 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Mon, 6 Jan 2020 21:06:41 +1100 Subject: [PATCH] Remove fuzzy match github repo reference + add logic context in summary 1. Remove the github repo reference as we have mixed in substring matching 2. Added context on how the logic is run --- Wox.Infrastructure/StringMatcher.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Wox.Infrastructure/StringMatcher.cs b/Wox.Infrastructure/StringMatcher.cs index 2d74c2f12..d71dddb23 100644 --- a/Wox.Infrastructure/StringMatcher.cs +++ b/Wox.Infrastructure/StringMatcher.cs @@ -41,7 +41,13 @@ namespace Wox.Infrastructure } /// - /// refer to https://github.com/mattyork/fuzzy + /// Current method: + /// Character matching + substring matching; + /// 1. Check query substring's character against full compare string, + /// 2. if matched, loop back to verify the previous character. + /// 3. If previous character also matches, and is the start of the substring, update list. + /// 4. Once the previous character is verified, move on to the next character in the query substring. + /// 5. Consider success and move onto scoring if every char or substring without whitespaces matched /// public static MatchResult FuzzySearch(string query, string stringToCompare, MatchOption opt) { @@ -127,7 +133,7 @@ namespace Wox.Infrastructure } } - // return rendered string if we have a match for every char or all substring without whitespaces matched + // return rendered string if every char or substring without whitespaces matched if (allQuerySubstringsMatched) { // check if all query substrings were contained in the string to compare