public List <string> GetWords(string name, string keyword) { var words = WordSplitHelper.GetSplitWordList(name.Replace(",", ","), JiebaTypeEnum.CutAll).ToList(); foreach (var key in keyword.Replace(",", ",").Split(',')) { if (!words.Contains(key)) { words.Add(key); } } return(words); }
public List <string> GetWords(string name, string keyword, int grade) { var words = WordSplitHelper.GetSplitWordList(name.Replace(",", ","), JiebaTypeEnum.CutAll).ToList(); foreach (var key in keyword.Replace(",", ",").Split(',')) { if (!words.Contains(key)) { words.Add(key); } } if (!words.Contains(CustomEnumHelper.Parse(typeof(GradeEnum), grade))) { words.Add(CustomEnumHelper.Parse(typeof(GradeEnum), grade)); } if (!words.Contains(name)) { words.Add(name); } return(words); }