Beispiel #1
0
 public void Initialize()
 {
     _parser = new Parser();
     _sorter = new Sorter();
     _testPath = "../../Resume.txt";
     _dictionary = _parser.ParseFile(_testPath).ToDictionary(t => t.Key, t => t.Value);
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            Parser parser = new Parser();
            Sorter sorter = new Sorter();
            string filePath = "../../../WordCloudAppTests/Summary.txt";
            Dictionary<string, int> dictionary = parser.ParseFile(filePath).ToDictionary(t => t.Key, t => t.Value);
            Dictionary<string, int> wordsUsedTwice = sorter.ThresholdResults(dictionary, 2, 2).ToDictionary(t => t.Key, t => t.Value);
            Dictionary<string, int> topTenWords = sorter.TopResults(dictionary).ToDictionary(t => t.Key, t => t.Value);
            string[] actualTopTenWords = topTenWords.Keys.ToArray();

            Console.WriteLine("The most used word is: " + actualTopTenWords[0]);
            Console.ReadLine();

            sorter = null;
            parser = null;
        }