我们如何使用语音在编辑框中填充数字 [英] How we populate digits in an Edit Box using Speech

查看:112
本文介绍了我们如何使用语音在编辑框中填充数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我尝试开发了一个小型实验应用程序,该应用程序将语音转换为文本并在EditBox上填充相同内容.它的工作完全正常(感谢Codeproject !! :))

现在,我希望它填充我所说的数字.例如,如果我说"7",它应该在编辑框上填充7,而不是七个" ...对于点",逗号",连字符"也应如此,

有什么办法可以做到这一点.输入将不胜感激.

顺便说一句,我正在使用MS Speech SDK 5.1.

谢谢,

Hi,

I tried to develop a small experimental application which will convert Speech to text and populate the same on an EditBox. Its working absolutely fine(Thanks to Codeproject !! :))

Now I want it to populate digits what I say. for example if I say "7" it should populate 7 on the editbox and not "seven"...the same should go for "dot", "comma", "Hyphen", like this,

Is there any way to do this. Inputs would be highly appreciated.

By the way I am using MS Speech SDK 5.1.

Thanks,

推荐答案

好,创建一个关联的容器,例如std::map(std::map<std::string, char>.使用成员函数find从语法中的已识别单词中查找数字;如果找不到数字,那么还有其他事情;将单词视为操作,标识符等.

—SA
Well, create an associated container such as std::map (http://en.wikipedia.org/wiki/Map_%28C%2B%2B%29[^]) to find digits by their names. The words like "one", "two"… will play the role of the keys, the digits will be found as characters, so you will need std::map<std::string, char>. Use member function find to find a digit by a recognized word from your grammar; if the digits is not found, so something else; consider a word as a operation, identifier, etc.

—SA


这篇关于我们如何使用语音在编辑框中填充数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆