public Dictionary <string, double> ExtractWordFrequency(string documentText) { string[] words = tokenizer.SplitToWords(documentText); ImmutableHashSet <string> stopWords = stopWordsProvider.GetStopWords(); words = words.Where(w => !stopWords.Contains(w.ToLower())).ToArray(); for (int i = 0; i < words.Length; ++i) { words[i] = stemmer.Stem(words[i]); } int totalCount = words.Length; Dictionary <string, double> result = wordCounter.CountWordFrequencies(words); return(result); }