ERROR: "jsgf.c", line 910: Failed to open etc/grammar.jsgf for parsing: No such file or directory
Traceback (most recent call last):
File "example_1.py", line 19, in <module>
decoder = Decoder(config)
File "/usr/local/lib/python2.7/dist-packages/pocketsphinx-0.0.8-py2.7-linux-x86_64.egg/pocketsphinx/pocketsphinx.py", line 228, in init
this = _pocketsphinx.new_Decoder(*args)
RuntimeError: new_Decoder returned -1</module>
Thank you Nickolay, I had found the solution for the issus.
I follow this web (Finite State Grammars) http://www.speech.cs.cmu.edu/15-492/homework/hw2/
After i convert the grammar file grammar.gram to grammar.fsg. I change the config in the code from:
config.set_string('-lm', 'etc/dkmt_1.lm.DMP')
to
config.set_string('-fsg', 'etc/grammar.fsg')
And the issus is solved.
Last edit: Nickolay V. Shmyrev 2015-11-08
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I want it to use a simple grammar(JSGF) in Spinx using Python. So I'm flowing this example:
https://github.com/cmusphinx/pocketsphinx/blob/master/swig/python/test/jsgf_test.py
But I got a following output in terminal:
And i found the suggestion in this topic:
https://sourceforge.net/p/cmusphinx/discussion/help/thread/d5e1a902/
After i follow the topic, i got another error:
I'm sure that i have the file etc/grammar.jsgf which i create with a text document.
I have attached all results in the terminal of 2 case in this link:
https://www.dropbox.com/s/hgd1n07pxtlg1cy/error_jsgf?dl=0
https://www.dropbox.com/s/logu2hchy44k95a/error_jsgf_1?dl=0
Please help me to sort out the issue.
Thanks and Regards,
DucLoc.
Last edit: Loc Le Duc 2015-11-06
To get help on this issue you need to provide all the files to reproduce your problem.
Thank you Nickolay, I had found the solution for the issus.
I follow this web (Finite State Grammars)
http://www.speech.cs.cmu.edu/15-492/homework/hw2/
After i convert the grammar file grammar.gram to grammar.fsg. I change the config in the code from:
to
And the issus is solved.
Last edit: Nickolay V. Shmyrev 2015-11-08