how to add a custom lexicon in my c # project

ぐ巨炮叔叔 提交于 2019-12-08 05:46:09

问题


I m developing an c# project based on voice recognition. I want to recognize words in Indian English accent so for that i thought for lexicon & then adding pronunciations in that file but I m not getting how to add a lexicon in my project & how to create a lexicon?


回答1:


Lexicons aren't exposed via System.Speech.Recognition, unfortunately. You can access lexicons using the SpeechLib automation interface to SAPI, though; the object you want to create is SpLexicon.

Note that System.Speech.Recognition will automatically load any user lexicons, so you can have a separate app to build the lexicon and your reco app can continue to use System.Speech.Recognition.

Also, if you're using a command & control grammar, you should specify pronunciations directly; for example, the SrgsToken class allows you to explicitly specify a pronunciation for the word. (Unfortunately, I can't remember how to do this with System.Speech.Recognition.GrammarBuilder, but it is possible.)



来源:https://stackoverflow.com/questions/21313934/how-to-add-a-custom-lexicon-in-my-c-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!