Is it possible to add/change JSGF rules at runtime in pocketsphinx? In Sphinx
4 it can be done like this:
jsgfGrammar.loadJSGF("music");
RuleGrammar ruleGrammar = new BaseRuleGrammar(jsapiRecognizer,
jsgfGrammar.getRuleGrammar());
addRule(ruleGrammar, "song1", "listen to over the rainbow");
addRule(ruleGrammar, "song2", "listen to as time goes by");
addRule(ruleGrammar, "song3", "listen to singing in the rain");
...
How to do this in pocketsphinx?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Pocketsphinx doesn't maintain JSGF as is but converts JSGF to FSG grammar
immediately.You can operate on FSG grammar using fsg_model.h API, for example
with fsg_model_trans_add function and then commit the changes with
ps_update_fsgset. But it's not that simple as addRule, you need to figure out
node ids in FSG grammar.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
Is it possible to add/change JSGF rules at runtime in pocketsphinx? In Sphinx
4 it can be done like this:
jsgfGrammar.loadJSGF("music");
RuleGrammar ruleGrammar = new BaseRuleGrammar(jsapiRecognizer,
jsgfGrammar.getRuleGrammar());
addRule(ruleGrammar, "song1", "listen to over the rainbow");
addRule(ruleGrammar, "song2", "listen to as time goes by");
addRule(ruleGrammar, "song3", "listen to singing in the rain");
...
How to do this in pocketsphinx?
Hello
Pocketsphinx doesn't maintain JSGF as is but converts JSGF to FSG grammar
immediately.You can operate on FSG grammar using fsg_model.h API, for example
with fsg_model_trans_add function and then commit the changes with
ps_update_fsgset. But it's not that simple as addRule, you need to figure out
node ids in FSG grammar.