public Dictionary <string, int> CountWords() { return(WordPattern.Matches(_text).Cast <Match>() .Select(m => m.Value.ToLower()) .GroupBy(word => word) .ToDictionary(g => g.Key, g => g.Count())); }
public static int GetWordCount(string content) { var wordsMatches = WordPattern.Matches(content); return(wordsMatches.Count); }