Click here to Skip to main content
15,881,967 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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,
Posted

1 solution

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
 
Share this answer
 
Comments
Simon Bang Terkildsen 16-Sep-11 18:14pm    
+5 good suggestion
Sergey Alexandrovich Kryukov 16-Sep-11 20:07pm    
Thank you, Simon.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900