I was trying to run all the demo programs for SPHINX4. I had no problems running the HelloWorld, HelloDigits, HelloN-Gram, ZipCity, WavFile, Transcriber, and Confidence demos.
But I was unable to run the JSGFDemo and Dialog demo jar files. When running JSGFDemo I get:
C:\sphinx4>java -mx312m -jar bin\JSGFDemo.jar
JSGF Demo Version 1.0
Loading recognizer ...I/O Error java.io.FileNotFoundException: JAR entry demo/jsapi/jsgf/commands.gram not found in C:\sphinx4\bin\JSGFDemo.jar
I am new to packages, JAR files, and SPHINX, but I had the following analysis:
Even though the demos are in edu/cmu/sphinx/demo/jsapi/jsgf/ package, the location is still /demo/jsapi/jsgf/ in line 102 of jsgf.config.xml :
<property name="grammarLocation"
value="resource:/edu.cmu.sphinx.demo.jsapi.jsgf.JSGFDemo!/demo/jsapi/jsgf/"/>
Changing it to:
value="resource:/edu.cmu.sphinx.demo.jsapi.jsgf.JSGFDemo!/edu/cmu/sphinx/demo/jsapi/jsgf/"/>
and rebuilding the demos lets the program proceed, but to fail again:
JSGF Demo Version 1.0
Loading recognizer ...
Ready
Exception in thread "main" java.lang.IllegalArgumentException: Unknown Rule: standard_commands
at com.sun.speech.engine.recognition.BaseRuleGrammar.isEnabled(BaseRuleG
rammar.java:222)
at edu.cmu.sphinx.jsapi.JSGFGrammar.isRuleDisabled(JSGFGrammar.java:441)
at edu.cmu.sphinx.jsapi.JSGFGrammar.parseRuleSequence(JSGFGrammar.java:4
92)
at edu.cmu.sphinx.jsapi.JSGFGrammar.parseRule(JSGFGrammar.java:278)
at edu.cmu.sphinx.jsapi.JSGFGrammar.parseRuleAlternatives(JSGFGrammar.ja
va:427)
at edu.cmu.sphinx.jsapi.JSGFGrammar.parseRule(JSGFGrammar.java:272)
at edu.cmu.sphinx.jsapi.JSGFGrammar.commitChanges(JSGFGrammar.java:595)
at edu.cmu.sphinx.jsapi.JSGFGrammar.loadJSGF(JSGFGrammar.java:233)
at edu.cmu.sphinx.demo.jsapi.jsgf.JSGFDemo.loadAndRecognize(JSGFDemo.jav
a:112)
at edu.cmu.sphinx.demo.jsapi.jsgf.JSGFDemo.execute(JSGFDemo.java:85)
at edu.cmu.sphinx.demo.jsapi.jsgf.JSGFDemo.main(JSGFDemo.java:224)
This time I think the problem is in the grammar file. When I substitute the following line in movies, music, news & books.gram files :
public <commands> = <standard_commands> ;
with:
public <commands> = go to the next menu { exit } ;
(copied from the imported commands.gram), it starts running(I could not check if it was recognizing).
But since the grammar files are exactly the same as in the release version, obviously something else is wrong. Again, I am new to JSGF, the original files seem correct, and my changes are bad hacks.
There are similar Jar file package path issue with the Dialog demo. But it does not have any problems with the grammar files, because it does not have any imports I guess.
I would appreciate it if somebody could point me out what is wrong with the grammar files/packages/the Jar file paths.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was trying to run all the demo programs for SPHINX4. I had no problems running the HelloWorld, HelloDigits, HelloN-Gram, ZipCity, WavFile, Transcriber, and Confidence demos.
But I was unable to run the JSGFDemo and Dialog demo jar files. When running JSGFDemo I get:
C:\sphinx4>java -mx312m -jar bin\JSGFDemo.jar
JSGF Demo Version 1.0
Loading recognizer ...I/O Error java.io.FileNotFoundException: JAR entry demo/jsapi/jsgf/commands.gram not found in C:\sphinx4\bin\JSGFDemo.jar
I am new to packages, JAR files, and SPHINX, but I had the following analysis:
Even though the demos are in edu/cmu/sphinx/demo/jsapi/jsgf/ package, the location is still /demo/jsapi/jsgf/ in line 102 of jsgf.config.xml :
<property name="grammarLocation"
value="resource:/edu.cmu.sphinx.demo.jsapi.jsgf.JSGFDemo!/demo/jsapi/jsgf/"/>
Changing it to:
value="resource:/edu.cmu.sphinx.demo.jsapi.jsgf.JSGFDemo!/edu/cmu/sphinx/demo/jsapi/jsgf/"/>
and rebuilding the demos lets the program proceed, but to fail again:
JSGF Demo Version 1.0
Loading recognizer ...
Ready
Exception in thread "main" java.lang.IllegalArgumentException: Unknown Rule: standard_commands
at com.sun.speech.engine.recognition.BaseRuleGrammar.isEnabled(BaseRuleG
rammar.java:222)
at edu.cmu.sphinx.jsapi.JSGFGrammar.isRuleDisabled(JSGFGrammar.java:441)
92)
at edu.cmu.sphinx.jsapi.JSGFGrammar.parseRule(JSGFGrammar.java:278)
at edu.cmu.sphinx.jsapi.JSGFGrammar.parseRuleAlternatives(JSGFGrammar.ja
va:427)
at edu.cmu.sphinx.jsapi.JSGFGrammar.parseRule(JSGFGrammar.java:272)
at edu.cmu.sphinx.jsapi.JSGFGrammar.commitChanges(JSGFGrammar.java:595)
at edu.cmu.sphinx.jsapi.JSGFGrammar.loadJSGF(JSGFGrammar.java:233)
at edu.cmu.sphinx.demo.jsapi.jsgf.JSGFDemo.loadAndRecognize(JSGFDemo.jav
a:112)
at edu.cmu.sphinx.demo.jsapi.jsgf.JSGFDemo.execute(JSGFDemo.java:85)
at edu.cmu.sphinx.demo.jsapi.jsgf.JSGFDemo.main(JSGFDemo.java:224)
This time I think the problem is in the grammar file. When I substitute the following line in movies, music, news & books.gram files :
public <commands> = <standard_commands> ;
with:
public <commands> = go to the next menu { exit } ;
(copied from the imported commands.gram), it starts running(I could not check if it was recognizing).
But since the grammar files are exactly the same as in the release version, obviously something else is wrong. Again, I am new to JSGF, the original files seem correct, and my changes are bad hacks.
There are similar Jar file package path issue with the Dialog demo. But it does not have any problems with the grammar files, because it does not have any imports I guess.
I would appreciate it if somebody could point me out what is wrong with the grammar files/packages/the Jar file paths.
I have just fixed this issue in svn, please update.
that seems to be a regression in trunk, we only need to find out which commit broke it. So far there were not so many changes in
http://cmusphinx.svn.sourceforge.net/viewvc/cmusphinx/trunk/sphinx4/src/research/com/sun/speech/engine/recognition/BaseRuleGrammar.java?view=log