Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Markov Bot = new Markov();

            //*
            Bot.LoadAuxiliaries("Auxiliaries.txt");
            Bot.LoadBanList("Bans.txt");
            Bot.LoadSwapList("Swaps.txt");
            Bot.Train("Training.txt");
            Bot.SaveBrain("BRAIN");

            /*/
             * Bot.LoadBrain("BRAIN");
             * //*/
            while (true)
            {
                Console.Write("> ");
                String Text = null;
                while (Text == null)
                {
                    Text = Console.ReadLine();
                }

                Console.WriteLine(Bot.GenerateReply(Text));
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Markov bot = new Markov();
            //*
            var sw = Stopwatch.StartNew();

            bot.LoadAuxiliaries("../../Files/Auxiliaries.txt");
            sw.Stop();
            Console.WriteLine($"Auxiliaries {sw.Elapsed.TotalMilliseconds.ToString("N0")} ms");

            sw = Stopwatch.StartNew();
            bot.LoadBanList("../../Files/Bans.txt");
            sw.Stop();
            Console.WriteLine($"Bans {sw.Elapsed.TotalMilliseconds.ToString("N0")} ms");

            sw = Stopwatch.StartNew();
            bot.LoadSwapList("../../Files/Swaps.txt");
            sw.Stop();
            Console.WriteLine($"Swaps {sw.Elapsed.TotalMilliseconds.ToString("N0")} ms");

            sw = Stopwatch.StartNew();
            bot.Train("../../Files/Training.txt");
            sw.Stop();
            Console.WriteLine($"Training {sw.Elapsed.TotalMilliseconds.ToString("N0")} ms");

            sw = Stopwatch.StartNew();
            bot.SaveBrain("../../Files/BRAIN.dat");
            sw.Stop();
            Console.WriteLine($"BRAIN {sw.Elapsed.TotalMilliseconds.ToString("N0")} ms");

            /*/
             * Bot.LoadBrain("../../Files/BRAIN.dat");
             * //*/
            while (true)
            {
                Console.Write("> ");
                String text = null;
                while (text == null)
                {
                    text = Console.ReadLine();
                }

                Console.WriteLine(bot.GenerateReply(text));
            }
        }