public void AnalyzeSearchYNCmdString(string CmdLine) { if (CmdLine.IndexOf("응") > -1 || CmdLine.IndexOf("그래") > -1) { RetryNum = 0; Program.ChromeReadDocList(0); } else if (CmdLine.IndexOf("아니") > -1 || CmdLine.IndexOf("하지마") > -1) { RetryNum = 0; } else { if (RetryNum >= 2) { Console.WriteLine("질문 세션을 취소합니다"); Program.GoogleTTS("질문 세션을 취소합니다"); RetryNum = 0; return; } prevCmdData = new CmdData("", (int)ChromeMotionCode.NaverSearch, ""); OnCmdanalyzed?.Invoke((int)ChromeMotionCode.NaverScanResult, new ChromeHandleValue()); RetryNum++; } }
public void AnalyzeCmdString(string CmdLine, int capturetype) { if (capturetype == (int)VoiceCaptureType.SearchYN) { if (prevCmdData.speechstring != null) { if (prevCmdData.ChromeMotionCode == (int)ChromeMotionCode.NaverSearch) { prevCmdData = new CmdData(); AnalyzeSearchYNCmdString(CmdLine); } else { prevCmdData = new CmdData(); } } return; } string[] MulitiCmdArgs = SplitCmdline(CmdLine); foreach (var CmdArg in MulitiCmdArgs) { if (CmdArg.IndexOf("검색") > -1) { if (CmdArg.Substring(0, 2) == "검색") { string SearchKey = CmdArg.Substring(2).Trim(); Console.WriteLine("|" + SearchKey + "|"); prevCmdData = new CmdData(CmdArg, (int)ChromeMotionCode.NaverSearch, SearchKey); OnCmdanalyzed?.Invoke((int)ChromeMotionCode.NaverSearch, new ChromeHandleValue(SearchKey)); } else { string SearchKey = ""; for (int i = 2; i < CmdArg.Length; i++) { int index2looking = CmdArg.Length - i; if (CmdArg.Substring(index2looking, 2) == "검색") { SearchKey = CmdArg.Substring(0, index2looking).Trim(); break; } } Console.WriteLine("|" + SearchKey + "|"); prevCmdData = new CmdData(CmdArg, (int)ChromeMotionCode.NaverSearch, SearchKey); OnCmdanalyzed?.Invoke((int)ChromeMotionCode.NaverSearch, new ChromeHandleValue(SearchKey)); } } else if (CmdArg.IndexOf("읽어") > -1) { } else if (CmdArg.IndexOf("열어") > -1) { } } }