Universal Windows App Development with Cortana and the Speech SDK 5

来源:互联网 发布:淘宝商品广告违规 编辑:程序博客网 时间:2024/05/20 07:58

5 Designing Apps with Speech

5.1 Speech Design Considerations

What can I say?  show commands
Make it fun. Add humor.
Keep grammar small. Allow variations of words.
Can lauch app using Cortana.

5.2 Interpreting User Intent

Natural Language Understanding

private void HandleNlpCommand(string recoText, bool actSilently){string action=null;string navigation=null;string searchFor=null;recoText =recoText.ToLower();if(recoText.Contains("go to")|| recoText.Contains("goto")||recoText.Contains("find")|| recoText.Contains("search")|| recoText.Contains("show me")){action="navigate";if(recoText.Contains( "Windows phone dev center")){navigateTo="http://dev.windowsphone.com";}}else if (recoText.Contains ("learn how to"){action="find";searchFor =recoText.Substring (recoText.IndexOf ("learn how to")+13);}else{action="find";searchFor=recoText;}switch(action){case "find" :}}


5.3 Handling Failures
5.4 Testing
5.5 Examples

0 0
原创粉丝点击