private bool MatchProgram(ControlPanelItem item, FuzzyMatcher matcher) { if (item.LocalizedString != null && (item.Score = matcher.Evaluate(item.LocalizedString).Score) > 0) return true; if (item.InfoTip != null && (item.Score = matcher.Evaluate(item.InfoTip).Score) > 0) return true; if (item.LocalizedString != null && (item.Score = matcher.Evaluate(item.LocalizedString.Unidecode()).Score) > 0) return true; return false; }
private int Score(ControlPanelItem item, string query) { var scores = new List <int>(); if (item.LocalizedString != null) { var score1 = StringMatcher.Score(item.LocalizedString, query); var socre2 = StringMatcher.ScoreForPinyin(item.LocalizedString, query); scores.Add(Math.Max(score1, socre2)); } if (item.InfoTip != null) { // todo should we add pinyin score for infotip also? var score = StringMatcher.Score(item.InfoTip, query); scores.Add(score); } return(scores.Max()); }
private bool MatchProgram(ControlPanelItem item, string query) { if (item.LocalizedString != null && (item.Score = StringMatcher.Match(item.LocalizedString, query)) > 0) { return(true); } if (item.InfoTip != null && (item.Score = StringMatcher.Match(item.InfoTip, query)) > 0) { return(true); } if (item.LocalizedString != null && (item.Score = StringMatcher.Match(item.LocalizedString.Unidecode(), query)) > 0) { return(true); } return(false); }
private bool MatchProgram(ControlPanelItem item, FuzzyMatcher matcher) { if (item.LocalizedString != null && (item.Score = matcher.Evaluate(item.LocalizedString).Score) > 0) { return(true); } if (item.InfoTip != null && (item.Score = matcher.Evaluate(item.InfoTip).Score) > 0) { return(true); } if (item.LocalizedString != null && (item.Score = matcher.Evaluate(item.LocalizedString.Unidecode()).Score) > 0) { return(true); } return(false); }
private int Score(ControlPanelItem item, string query) { var scores = new List <int> { 0 }; if (string.IsNullOrEmpty(item.LocalizedString)) { var score1 = StringMatcher.Score(item.LocalizedString, query); var score2 = StringMatcher.ScoreForPinyin(item.LocalizedString, query); scores.Add(score1); scores.Add(score2); } if (!string.IsNullOrEmpty(item.InfoTip)) { var score1 = StringMatcher.Score(item.InfoTip, query); var score2 = StringMatcher.ScoreForPinyin(item.InfoTip, query); scores.Add(score1); scores.Add(score2); } return(scores.Max()); }
private int Score(ControlPanelItem item, string query) { var scores = new List <int> { 0 }; if (!string.IsNullOrEmpty(item.LocalizedString)) { var score1 = StringMatcher.FuzzySearch(query, item.LocalizedString).ScoreAfterSearchPrecisionFilter(); var score2 = StringMatcher.ScoreForPinyin(item.LocalizedString, query); scores.Add(score1); scores.Add(score2); } if (!string.IsNullOrEmpty(item.InfoTip)) { var score1 = StringMatcher.FuzzySearch(query, item.InfoTip).ScoreAfterSearchPrecisionFilter(); var score2 = StringMatcher.ScoreForPinyin(item.InfoTip, query); scores.Add(score1); scores.Add(score2); } return(scores.Max()); }
private int Score(ControlPanelItem item, string query) { var scores = new List<int>(); if (item.LocalizedString != null) { var score1 = StringMatcher.Score(item.LocalizedString, query); var socre2 = StringMatcher.ScoreForPinyin(item.LocalizedString, query); scores.Add(Math.Max(score1, socre2)); } if (item.InfoTip != null) { // todo should we add pinyin score for infotip also? var score = StringMatcher.Score(item.InfoTip, query); scores.Add(score); } return scores.Max(); }
private int Score(ControlPanelItem item, string query) { var scores = new List<int> {0}; if (string.IsNullOrEmpty(item.LocalizedString)) { var score1 = StringMatcher.Score(item.LocalizedString, query); var score2 = StringMatcher.ScoreForPinyin(item.LocalizedString, query); scores.Add(score1); scores.Add(score2); } if (!string.IsNullOrEmpty(item.InfoTip)) { var score1 = StringMatcher.Score(item.InfoTip, query); var score2 = StringMatcher.ScoreForPinyin(item.InfoTip, query); scores.Add(score1); scores.Add(score2); } return scores.Max(); }
private bool MatchProgram(ControlPanelItem item, string query) { if (item.LocalizedString != null && (item.Score = StringMatcher.Match(item.LocalizedString, query)) > 0) return true; if (item.InfoTip != null && (item.Score = StringMatcher.Match(item.InfoTip, query)) > 0) return true; if (item.LocalizedString != null && (item.Score = StringMatcher.Match(item.LocalizedString.Unidecode(), query)) > 0) return true; return false; }