示例#1
0
        public static void Recognise(
            IntentRegonisor recognizer, VirtualAssistant persona)
        {
            var result = recognizer.RecognizeOnce();

            switch (result.Reason)
            {
            case ResultReason.RecognizedIntent:

                Logger.OnIntentRecognised(result);

                persona.OnIntentRecognised(result);

                break;

            case ResultReason.RecognizedSpeech:

                Logger.OnSpeechRecognised(result);

                break;

            default:
                Logger.OnSpeechUnrecognised();

                break;
            }
        }
示例#2
0
        public static void Main()
        {
            var recognizer = new IntentRegonisor();

            var persona = new VirtualAssistant();

            Console.WriteLine("Say something...");

            do
            {
                Recognise(recognizer, persona);
            }while (true);
        }