Beispiel #1
0
        static void Main(string[] args)
        {
            Recognizer recognizer = new Recognizer();
            IInputReader inputReader = new FileReader(Properties.Settings.Default.InputFile);
            IInputReader glossaryReader = new FileReader(Properties.Settings.Default.GlossaryFile);

            recognizer.Run(inputReader, glossaryReader);
        }
Beispiel #2
0
        void har_Recognition(object sender, Recognizer.RecognitionEventArgs e)
        {
            this.window.Dispatcher.BeginInvoke(new Action(
                    delegate()
                    {
                        this.window.action.Text = e.Class;
                        this.window.score.Text = e.Likelihood.ToString();
                        if (e.Class == "")
                        {
                            this.window.score.Foreground = new SolidColorBrush(Colors.Red);
                        }
                        else
                        {
                            this.window.score.Foreground = new SolidColorBrush(Colors.Green);
                        }
                    }));

            if (e.Class != "")
            {
                this.nao.speak("You are performing " + e.Class);
                this.har.stop();
                this.switchStates(State.start);
            }
            else
            {
                this.nao.speak("I don't know what you are doing.");
            }
        }