Exemplo n.º 1
0
        public Recognition.Response Execute(string input, string ruleName)
        {
            string[] s = ruleName.Split('|');
            speech.Respond(input, s[s.Length - 1]);
            switch (s[s.Length - 1])
            {
            }

            Recognition.Response r = new Recognition.Response();
            r.grammars = LoadGrammar();
            return(r);
        }
Exemplo n.º 2
0
        private Recognition.Response Search(string query)
        {
            Recognition.Response re = new Recognition.Response();
            re.grammars = new Grammar[0];

            Regex r = new Regex(@"(on|about) ((\w|\s)+) please", RegexOptions.Compiled);
            Match m = r.Match(query);

            if (m.Groups.Count > 1)
            {
                query = m.Groups[2].Value;
                wolf.Search(query);
                string text = wiki.Search(query);
                re.data = text;
                speech.Speak(text);
            }

            return(re);
        }
Exemplo n.º 3
0
        public Recognition.Response Execute(string input, string ruleName)
        {
            string[] s = ruleName.Split('|');
            speech.Respond(input, s[s.Length - 1]);
            switch (s[s.Length - 1])
            {
            case "playfilm":
                Play(input);
                return(End());

            case "resumefilm":
                PlayPause();
                return(End());

            case "playpausefilm":
                PlayPause();
                return(End());

            case "choosefilm":
                RandFilm();
                return(End());

            case "fullscreen":
                FullScreen();
                return(End());

            case "mute":
                Mute();
                return(End());

            case "showfilms":
                //  BuildWindow(GetFilms());
                Recognition.Response res = new Recognition.Response();
                res.grid     = Test(GetFilms());
                res.grammars = LoadGrammar();
                return(res);
            }

            Recognition.Response r = new Recognition.Response();
            r.grammars = LoadGrammar();
            return(r);
        }
Exemplo n.º 4
0
        private Recognition.Response GetWeather()
        {
            Recognition.Response res = new Recognition.Response();
            Conditions           con = getConditions();
            string text = "It is " + con.weatherType + ". the temperature outside is " + con.temp.ToString() + " degrees";

            if (con.temp != con.feelsLike)
            {
                text += ", but it feels like " + con.feelsLike.ToString() + " degrees due to the wind " + con.windType;
            }
            else
            {
                text += ", there is wind " + con.windType;
            }

            res.text = text;


            return(res);
        }
Exemplo n.º 5
0
 private Recognition.Response End()
 {
     Recognition.Response r = new Recognition.Response();
     r.grammars = new Grammar[0];
     return(r);
 }