예제 #1
0
        static void speechRecognitionWithDictationGrammar_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            ConnectDataLayerGetCommands Data        = new ConnectDataLayerGetCommands();
            List <CommandService>       ListCommand = Data.GetAllCommands();

            if (e.Result.Text == "Close")
            {
                manualResetEvent.Set();
                return;
            }

            if (e.Result.Text != "")
            {
                List <string> Sentence     = new List <string>();
                string        wholSentence = e.Result.Text;
                //MessageBox.Show(wholSentence.Trim().Split(' ').Length.ToString());
                // MessageBox.Show(wholSentence);
                if (wholSentence.Trim().Split(' ').Length > 1)
                {
                    //wholSentence = wholSentence.Substring(0, wholSentence.IndexOf(" "));
                    MessageBox.Show("Recognized word :" + wholSentence, "Alert", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    MaketheLableVisible(wholSentence);
                    Sentence = wholSentence.Trim().Split(' ').ToList();

                    foreach (var word in Sentence)
                    {
                        string MalayalamWord = GoogleIntegratedApi(word);
                        if (MalayalamWord != "NIL")
                        {
                            if (ListCommand.Any(x => x.Manglish.Trim() == word.Trim()))
                            {
                                ConvertManglishtoMalayalam(MalayalamWord);
                            }
                        }
                    }
                }
                else
                {
                    string MalayalamWord = GoogleIntegratedApi(wholSentence);
                    if (MalayalamWord != "NIL")
                    {
                        if (ListCommand.Any(x => x.Manglish.Trim() == wholSentence.Trim()))
                        {
                            ConvertManglishtoMalayalam(MalayalamWord);
                        }
                    }
                }
            }
        }
예제 #2
0
        public bool InsertCommand(CommandService cmdService)
        {
            ConnectDataLayerGetCommands commandData = new ConnectDataLayerGetCommands();

            return(commandData.InsertCommandData(cmdService));
        }
예제 #3
0
        public List <CommandService> CommandList()
        {
            ConnectDataLayerGetCommands commandData = new ConnectDataLayerGetCommands();

            return(commandData.FetchCommands());
        }