コード例 #1
0
        public IList <KeyValuePair <string, int> > CountTopWords(string source, int top)
        {
            var text     = textReader.SourceText(source);
            var words    = textWordCounter.CountWords(text);
            var topWords = words.OrderByDescending(x => x.Value).Take(top);

            return(topWords.ToList());
        }