Example #1
0
        public static void En2EndTest(string utterance)
        {
            IntentController controller = new IntentController();
            string           resp       = controller.Answer(null, utterance);

            Console.WriteLine(resp);
        }
Example #2
0
        public static void End2EndTestForFile(string inputfile, string outputfile)
        {
            IntentController controller = new IntentController();

            string[] lines = File.ReadAllLines(inputfile);
            int      index = 1;

            using (StreamWriter w = new StreamWriter(File.Open(outputfile, FileMode.Create), Encoding.UTF8))
            {
                foreach (string question in lines)
                {
                    string answer = controller.Answer(index.ToString(), question);
                    w.WriteLine("[Question]: " + question);
                    w.WriteLine("[Answer]:   " + answer);
                    w.WriteLine("\r\n");

                    index++;
                }
            }
        }