private void AddWordCount(string word) { Word stemmedWord = Stemmer.StemWord(word, Rules); if (string.IsNullOrEmpty(word) || word == " " || word == "\n" || word == "\t") { return; } Word foundWord = WordCounts.Find(match => match.Stem == stemmedWord.Stem); if (foundWord == null) { WordCounts.Add(stemmedWord); } else { foundWord.TermFrequency++; } }
private void AddWordCount(string word) { Word stemmedWord = Stemmer.StemWord(word, this.Rules); if (word == null || word == string.Empty || word == " " || word == "\n" || word == "\t") { return; } Word foundWord = WordCounts.Find(delegate(Word match) { return(match.Stem == stemmedWord.Stem); }); if (foundWord == null) { WordCounts.Add(stemmedWord); } else { foundWord.TermFrequency++; } }