Beispiel #1
0
        private static void ComputeAllNGramsFrequencies()
        {
            Console.WriteLine("For which values of 'n'?");
            Console.WriteLine("Min value of n?");
            var min = int.Parse(Console.ReadLine());

            Console.WriteLine("Max value of n?");
            var max = int.Parse(Console.ReadLine());

            Console.WriteLine("How many sentences do you want to parse?");
            var nbOfSentencesToParse = int.Parse(Console.ReadLine());

            Console.WriteLine("Flush the ngrams with frequency below:");
            var flushMinFrequency = int.Parse(Console.ReadLine());

            Console.WriteLine("Flush ngrams with low frequency every x sentence. x?");
            var flushNbOfSentences = int.Parse(Console.ReadLine());

            for (var i = min; i <= max; i++)
            {
                Console.WriteLine("n = {0}", i);
                var ngramFreqBuilder = new NGramFrequencyBuilder(i, Utilities.PathToDownloadDirectory, nbOfSentencesToParse,
                                                                 flushMinFrequency, flushNbOfSentences);
                ngramFreqBuilder.ComputeNgramsFrequencies();

                Console.WriteLine("==============");
                Console.WriteLine();
            }
        }
Beispiel #2
0
        private static void ComputeNgramsFrequencies()
        {
            Console.WriteLine("For which value of 'n'?");
            var n = int.Parse(Console.ReadLine());

            Console.WriteLine("How many sentences do you want to parse?");
            var nbOfSentencesToParse = int.Parse(Console.ReadLine());

            Console.WriteLine("Flush the ngrams with frequency below:");
            var flushMinFrequency = int.Parse(Console.ReadLine());

            Console.WriteLine("Flush ngrams with low frequency every x sentence. x?");
            var flushNbOfSentences = int.Parse(Console.ReadLine());

            var ngramFreqBuilder = new NGramFrequencyBuilder(n, Utilities.PathToDownloadDirectory, nbOfSentencesToParse,
                                                             flushMinFrequency, flushNbOfSentences);

            ngramFreqBuilder.ComputeNgramsFrequencies();
        }