This type of recognition is supported and works perfectly for me here with
test of pocketsphinx_batch. I'm using latest pocketsphinx trunk though. If you
still has issues, setup a little test using pocketsphinx_batch and share the
recordings that you attempt to recognize.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've just tried the latest trunk and unfortunately am getting the same result.
PocketSphinx works fine if I start it up with a jsgf grammar of (LEFT|RIGHT)
but if I start with WALK (LEFT|RIGHT) and change to (LEFT|RIGHT) at runtime
then it fails. I'm digging further into the problem now. I'll let you know
what I find.
Cheers,
Paul
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using Pocketsphinx 0.6, generating small JSGF grammars in code and
switching between them.
This grammar works perfectly:
public <shortcommand>= WALK (LEFT|RIGHT); </shortcommand>
as does this:
public <shortcommand>= (LEFT|RIGHT) WALK; </shortcommand>
Whereas this fails to be recognised every single time:
public <shortcommand>= (LEFT|RIGHT); </shortcommand>
Is this type of single word recognition supported?
Thanks for your help,
Paul
Hello Paul
This type of recognition is supported and works perfectly for me here with
test of pocketsphinx_batch. I'm using latest pocketsphinx trunk though. If you
still has issues, setup a little test using pocketsphinx_batch and share the
recordings that you attempt to recognize.
I've just tried the latest trunk and unfortunately am getting the same result.
PocketSphinx works fine if I start it up with a jsgf grammar of (LEFT|RIGHT)
but if I start with WALK (LEFT|RIGHT) and change to (LEFT|RIGHT) at runtime
then it fails. I'm digging further into the problem now. I'll let you know
what I find.
Cheers,
Paul
Hi, This was caused my by bad grammar reloading code.
Before I had:
//Now build the new one
fsg_set_t pCurrentGrammar = ps_get_fsgset( ps );
fsg_model_t pNewFSGModel = jsgf_build_fsg( pJSGF, rule, ps_get_logmath(ps),
6.5);
if( pNewFSGModel )
{
pCurrentGrammar->fsg = pNewFSGModel;
ps_update_fsgset(ps);
}
Now I have:
fsg_set_t *pCurrentGrammar = ps_get_fsgset( ps );
//Free the previous grammar
fsg_model_free(pCurrentGrammar->fsg);
//Now build the new one
fsg_model_t *pNewFSGModel = jsgf_build_fsg( pJSGF, rule, ps_get_logmath(ps),
6.5);
if( pNewFSGModel )
{
fsg_model_t *pCorrectedFSGModel = fsg_set_add(pCurrentGrammar,
fsg_model_name(pNewFSGModel), pNewFSGModel);
if (pCorrectedFSGModel != pNewFSGModel)
{
assert(false);
}
if (fsg_set_select(pCurrentGrammar, fsg_model_name(pNewFSGModel)) == NULL)
{
assert(false);
}
ps_update_fsgset(ps);
}
All seems fine.
I may be leaking a jsgf_t, but this seems to work now.
Apologies for any confusion caused.
Paul