src/modules/launcher/Plugins/Microsoft.Plugin.WindowWalker/Components/FuzzyMatching.cs
/// <summary>
/// Calculates the score for a string
/// </summary>
/// <param name="matches">the index of the matches</param>
/// <returns>an integer representing the score</returns>
Calculates the score for a string
Calculates the score for a string
public static int CalculateScoreForMatches(List<int> matches)
        {
            var score = 0;
            for (int currentIndex = 1; currentIndex < matches.Count; currentIndex++)
            {
                var previousIndex = currentIndex - 1;
                score -= matches[currentIndex] - matches[previousIndex];
            }
            return score == 0 ? -10000 : score;
        }
public static int CalculateScoreForMatches ( List < int > matches ) { var score = 0 ; for ( int currentIndex = 1 ; currentIndex < matches . Count ; currentIndex ++ ) { var previousIndex = currentIndex - 1 ; score -= matches [ currentIndex ] - matches [ previousIndex ] ; } return score == 0 ? - 10000 : score ; }
Calculates the score for a string
Calculates the score for a string
an integer representing the score
an integer representing the score
matches
List<int>
the index of the matches
the index of the matches