Esempio n. 1
0
        private static List <MatchResult> Score(string title, string filterText)
        {
            var startsWithMatcher            = new StartsWithMatcher();
            var containsMatcher              = new ContainsMatcher();
            var significantCharactersMatcher = new SignificantCharactersMatcher();
            var individualCharactersMatcher  = new IndividualCharactersMatcher();

            var results = new List <MatchResult>
            {
                startsWithMatcher.Evaluate(title, filterText),
                significantCharactersMatcher.Evaluate(title, filterText),
                containsMatcher.Evaluate(title, filterText),
                individualCharactersMatcher.Evaluate(title, filterText)
            };

            return(results);
        }
Esempio n. 2
0
        private static MatchResult Evaluate(string input, string pattern)
        {
            var matcher = new StartsWithMatcher();

            return(matcher.Evaluate(input, pattern));
        }