Esempio n. 1
0
        private static void OutputStatistics(BagOfWords bag)
        {
            Console.Out.WriteLine("Statistics for document '{0}':", bag.Name);
            Console.Out.WriteLine("- number of docs: {0}", bag.DocumentsCount);
            Console.Out.WriteLine("- number of words: {0}", bag.Words.Count);
            Console.Out.WriteLine("- number of stems: {0}", bag.WordsFrequency.Count);
            Console.Out.WriteLine("- number of labels: {0}", bag.Labels.Count);

            Console.Out.WriteLine("- list of labels:");
            var bagSorted = bag.GetSortedLabels();

            foreach (KeyValuePair <string, BagOfWords.WordFrequency> word in bagSorted)
            {
                Console.Out.WriteLine("\t{0}\t\t- {1} - {2}", word.Key, word.Value.Count, word.Value.Frequency);
            }
            Console.Out.WriteLine("---------------------");
            Console.Out.WriteLine();
        }