-1

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.

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 );

I added 'Yes','No' and 'Yummy' in my this .gram file.

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>
Umar Asghar
  • 3,808
  • 1
  • 36
  • 32
  • question is that. After updating the hello.gram file means by adding new words in gram file, the program does load or recognize the added words in hello.gram file. How can I load it as well? – Umar Asghar Nov 19 '15 at 10:07

1 Answers1

0

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>

is from the configuration file.

Alexander Solovets
  • 2,447
  • 15
  • 22