Menu

Pocketsphinx 0.6 JSGF single word support

Help
Paul
2010-06-23
2012-09-22
  • Paul

    Paul - 2010-06-23

    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

     
  • Nickolay V. Shmyrev

    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.

     
  • Paul

    Paul - 2010-06-23

    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

     
  • Paul

    Paul - 2010-06-25

    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

     

Log in to post a comment.