Hello,
I tried to add a way to dynamically modify the grammar in pocketsphinx (I'm
using the latest revision of ps and sphinxbase). I made the function
ps_set_fsg_from_rule_list which can be called between one utterance and
another to change the grammar. It takes a list of rule names (of the jsgf) and
should replace the current fsg set with another made with these rules.
The jsgf_set_from_rule_list function sets the new jsgf grammar and returns the
root rule. Can you please tell me if you think the above function cleans and
sets the new grammar properly? From what i've tested so far it seems to work,
though.
Thanks for your attention.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you please tell me if you think the above function cleans and sets the
new grammar properly?
This function accesses the pocketsphinx internals, it's not recommended to do
that. For example to get fsg set you need to use the function ps_get_fsgset.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I tried to add a way to dynamically modify the grammar in pocketsphinx (I'm
using the latest revision of ps and sphinxbase). I made the function
ps_set_fsg_from_rule_list which can be called between one utterance and
another to change the grammar. It takes a list of rule names (of the jsgf) and
should replace the current fsg set with another made with these rules.
The jsgf_set_from_rule_list function sets the new jsgf grammar and returns the
root rule. Can you please tell me if you think the above function cleans and
sets the new grammar properly? From what i've tested so far it seems to work,
though.
Thanks for your attention.
This function accesses the pocketsphinx internals, it's not recommended to do
that. For example to get fsg set you need to use the function ps_get_fsgset.
Thanks for the advice.
So I assume the function calls to remove the old fsg and set the new one make
sense.