示例#1
0
        public static void Main(string[] args)
        {
            string version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
            Console.WriteLine("Prelude@# ("+version+") command line version, welcome user!");
            Console.WriteLine("if you want to stop chatting, enter: 'exit'");
            //initialize interface
            PreLudeInterface pi = new PreLudeInterface();

            //configure prelude
            //define path to mind file
            pi.loadedMind = "mind.mdu";
            //decide whether you want true randomness
            pi.quantumRandomness = false;
            pi.isSpeaking = true;
            pi.setProactiveMode(true);
            pi.avoidLearnByRepeating = true;

            pi.initializedAssociater = Mind.MatchingAlgorithm.Dice;

            //start your engine ...
            pi.initializeEngine();
            //here we go:
            while(!ind.StartsWith("exit"))
            {
                Console.Write("You say: ");
                ind = Console.ReadLine();
                logger.Trace("You say: " + ind);
                string answer = pi.chatWithPrelude(ind);
                Console.WriteLine("Prelude says: " + answer);
                logger.Trace("Prelude says: " + answer);
            }
            pi.stopPreludeEngine();
        }
示例#2
0
 public static void Main(string[] args)
 {
     Console.WriteLine("Prelude@# (0.5.0) command line version, welcome user!");
     Console.WriteLine("if you want to stop chatting, enter: 'exit'");
     //initialize interface
     pi = new PreLudeInterface();
     //auto speak handler (if bored...)
     pi.reportBoredom += new PreLudeInterface.AutoSpeakHandler(iamBored);
     //define path to mind file
     pi.loadedMind = "mind.mdu";
     //start your engine ...
     pi.initializeEngine();
     //here we go:
     while(!ind.StartsWith("exit"))
     {
         Console.Write("You say: ");
         ind = Console.ReadLine();
         Console.WriteLine("Prelude says: " + pi.chatWithPrelude(ind));
     }
     pi.stopPreludeEngine();
 }