I'm using MSVC++ and a JSGF file that I've used successfully with Sphinx4 ... I'm loading the JSGF with a "-jsgf" and filename in cmd_ln_init.
I have no errors but I can get a voice result from only one rule in the jsgf. I've stepped through the cmd_ln_init and found that the parser successfully finds all the rules in the jsgf, but then in pocketsphinx.c, ps_set_jsgf_file and ps_set_jsgf_string only use ONE rule from the grammar file, whereas I have several rules in the jsgf that I need to use.
I've searched this forum, google, and the documentation ... what am I missing? I can't imagine I'm the only one trying to use multiple rules from a jsgf.
Thank you in advance for your time, as well as supporting this great library.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using MSVC++ and a JSGF file that I've used successfully with Sphinx4 ... I'm loading the JSGF with a "-jsgf" and filename in cmd_ln_init.
I have no errors but I can get a voice result from only one rule in the jsgf. I've stepped through the cmd_ln_init and found that the parser successfully finds all the rules in the jsgf, but then in pocketsphinx.c, ps_set_jsgf_file and ps_set_jsgf_string only use ONE rule from the grammar file, whereas I have several rules in the jsgf that I need to use.
I've searched this forum, google, and the documentation ... what am I missing? I can't imagine I'm the only one trying to use multiple rules from a jsgf.
Thank you in advance for your time, as well as supporting this great library.
Add a rule to your grammar which allows others as alternatives:
and use that instead.
Thanks for the quick response ... how do I get pocketsphinx to use the <final_rule>? put it last?</final_rule>
or I guess I could make the <final_rule> the only public one ... right ?</final_rule>
I removed public from all the rules except the <final_rule> as you recommended and it works great!</final_rule>
Thank you Nickolay!