Exemple #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();
        }
        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
            PreLudeInterface pi = new PreLudeInterface();

            //define path to mind file
            pi.loadedMind          = "mind.mdu";
            pi.usesInvalidWordList = false;
            //start your engine ...
            pi.initializeEngine();
            pi.maxMatchesAllowed = 3;
            pi.setProactiveMode(true);
            //here we go:
            while (!ind.StartsWith("exit"))
            {
                Console.Write("You say: ");
                ind = Console.ReadLine();
                Console.WriteLine("Prelude says: " + pi.chatWithPrelude(ind));
            }
            pi.stopPreludeEngine();
        }