Menu

PocketSphinx -jsgf only loading ONE rule

Help
Moodicus78
2015-04-24
2015-04-25
  • Moodicus78

    Moodicus78 - 2015-04-24

    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.

     
    • Nickolay V. Shmyrev

      Add a rule to your grammar which allows others as alternatives:

       public <final_rule> = <rule1> | <rule2> | <rule3>;
      

      and use that instead.

       
  • Moodicus78

    Moodicus78 - 2015-04-24

    Thanks for the quick response ... how do I get pocketsphinx to use the <final_rule>? put it last?</final_rule>

     
  • Moodicus78

    Moodicus78 - 2015-04-24

    or I guess I could make the <final_rule> the only public one ... right ?</final_rule>

     
  • Moodicus78

    Moodicus78 - 2015-04-25

    I removed public from all the rules except the <final_rule> as you recommended and it works great!</final_rule>

    Thank you Nickolay!

     

Log in to post a comment.