我想在Sphinx4中使用自己的语法文件或hello world demo更新的语法文件 [英] I want to use my own gram file or hello world demo updated gram file in Sphinx4
问题描述
实际上,您好,世界演示示例中有几个单词,但我想在其中添加更多单词.似乎可以通过两种方式进行. 1.更新hello.gram文件 2.创建我自己的gram文件. 但是问题是我无法选择任何一种方式.你能帮我吗.谢谢你的时间.对不起,英语不好.
Actually hello world demo example has a few words but I want to add more words in it. Its seems possible to do either two ways. 1. Update the hello.gram file 2. create my own gram file. But the issue is that I'm unable to do either way. Can you please help me in it. Thanks for your time. Sorry for bad english.
这是我更新的hello.gram文件.我没有更新其他文件.请这种方式帮助我. hello.gram文件
Here is my hello.gram file which I updated. I updated no other file. Please help me in this sort. hello.gram file
#JSGF V1.0;
/**
* JSGF Grammar for Hello World example
*/
grammar hello;
public <greet> = (Good morning | Hello | Yes | No | Yummy) ( Bhiksha | Evandro | Paul | Philip | Rita | Will );
我在此.gram文件中添加了是",否"和美味".
I added 'Yes','No' and 'Yummy' in my this .gram file.
hello.config.xml(此文件中的jsgf语法配置部分)
hello.config.xml (jsgf Grammar configuration part from this file)
<!-- ******************************************************** -->
<!-- The Grammar configuration -->
<!-- ******************************************************** -->
<component name="jsgfGrammar" type="edu.cmu.sphinx.jsapi.JSGFGrammar">
<property name="dictionary" value="dictionary"/>
<property name="grammarLocation"
value="resource:/demo.sphinx.helloworld.elloWorld!/demo/sphinx/helloworld/"/>
<property name="grammarName" value="hello"/>
<property name="logMath" value="logMath"/>
</component>
推荐答案
您发布的文件不是有效的JSGF文件.这部分
The file that you posted is not a valid JSGF file. This part
<!-- ******************************************************** -->
<!-- The Grammar configuration -->
<!-- ******************************************************** -->
<component name="jsgfGrammar" type="edu.cmu.sphinx.jsapi.JSGFGrammar">
<property name="dictionary" value="dictionary"/>
<property name="grammarLocation"
value="resource:/demo.sphinx.helloworld.elloWorld!/demo/sphinx/helloworld/"/>
<property name="grammarName" value="hello"/>
<property name="logMath" value="logMath"/>
</component>
来自配置文件.
这篇关于我想在Sphinx4中使用自己的语法文件或hello world demo更新的语法文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!