Exemplo n.º 1
0
        public void Ask_Question(string address)
        {
            //OSAEObjectProperty prop = OSAEObjectPropertyManager.GetObjectPropertyValue("Vaughn", "JabberID");
            DataSet dataset = new DataSet();

            dataset = OSAESql.RunSQL("SELECT Question,object_name,property_name,property_datatype,property_object_type,interest_level FROM osae_v_interests ORDER BY interest_level DESC LIMIT 1");
            if (dataset.Tables[0].Rows.Count > 0)
            {
                string sQuestion = dataset.Tables[0].Rows[0]["Question"].ToString();
                sendMessage(gCurrentUser, Common.PatternParse(sQuestion), address);
                //Unload All grammars
                oRecognizer.UnloadAllGrammars();
                //Load Answer grammer based on Property Object Type plus Unknown and None
                oRecognizer = OSAEGrammar.Load_Answer_Grammar(oRecognizer, dataset.Tables[0].Rows[0]["property_datatype"].ToString(), dataset.Tables[0].Rows[0]["property_object_type"].ToString());
                //set a AskingQuestionVariables so recognition can run an QuestionedAnswered routine
                gAnswerObject   = dataset.Tables[0].Rows[0]["object_name"].ToString();
                gAnswerProperty = dataset.Tables[0].Rows[0]["property_name"].ToString();
                Log.Info("-> Asking: " + sQuestion + "  (" + gAnswerObject + "," + gAnswerProperty + ")");
            }
        }