public List <string> CheckWord(string word) { string soundex = Soundex.GetSoundex(word); var closeWords = WordSoundexes[word]; if (closeWords.Count == 0) { return(default);
public void AddCollectionToDictionary(IEnumerable <string> x) { WordSoundexes = new Dictionary <string, List <string> >(); foreach (var word in x) { if (word.All(char.IsLetter)) { var soundex = Soundex.GetSoundex(word); if (!WordSoundexes.ContainsKey(soundex)) { WordSoundexes.Add(soundex, new List <string>()); } WordSoundexes[soundex].Add(word); } } }