【发布时间】:2015-12-11 04:57:00
【问题描述】:
实际上 hello world 演示示例有几个词,但我想在其中添加更多词。它似乎可以通过两种方式进行。 1.更新hello.gram文件 2. 创建我自己的 gram 文件。 但问题是我无法做到这两种方式。你能帮我吗?谢谢你的时间。抱歉英语不好。
这是我更新的 hello.gram 文件。我没有更新其他文件。请帮我解决这个问题。 hello.gram 文件
#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 文件中添加了“Yes”、“No”和“Yummy”。
hello.config.xml(来自此文件的 jsgf 语法配置部分)
<!-- ******************************************************** -->
<!-- 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>
【问题讨论】:
-
问题是这样的。更新 hello.gram 文件意味着通过在 gram 文件中添加新单词,程序会加载或识别 hello.gram 文件中添加的单词。我怎样才能加载它?