Пример #1
0
        public static void RailwayChildren_HardCodedPrimes()
        {
            var sw = new Stopwatch();

            sw.Start();

            CompareTheWords.Compare("RailwayChildren.txt");

            sw.Stop();
            Console.WriteLine("{0} = Railway Children hardcoded primes", sw.Elapsed);
        }
Пример #2
0
        public static void RailwayChildrenVersion1()
        {
            var sw = new Stopwatch();

            sw.Start();

            CompareTheWords.Compare("RailwayChildren.txt");

            sw.Stop();
            Console.WriteLine("{0} = RailWay Children Regular", sw.Elapsed);
        }
Пример #3
0
        public static void RailwayChildren_NoRegex()
        {
            var sw = new Stopwatch();

            sw.Start();

            CompareTheWords.Compare("RailwayChildren.txt");

            sw.Stop();
            Console.WriteLine("{0} = Railway Children no regex", sw.Elapsed);
        }
Пример #4
0
        public static void Output()
        {
            IFileReader            fileReader            = new FileReader();
            IWordCounter           wordCounter           = new WordCounter();
            IPrimeNumberCalculator primeNumberCalculator = new PrimeNumberCalculator();
            IOutputGenerator       outputGenerator       = new OutputGenerator();
            var compareTheWords = new CompareTheWords(fileReader, wordCounter, primeNumberCalculator, outputGenerator);

            var railwayChildren             = compareTheWords.Compare("RailwayChildren.txt");
            var railwayChildrenTop10Results = railwayChildren.Take(10).ToList();

            Console.WriteLine("Word Frequency Count for Railway Childen");
            railwayChildrenTop10Results.ForEach(Console.WriteLine);
        }