Reply To: Enabling JSGF causes an EXC_BAD_ACCESS error

Home Forums OpenEars Compatibility issue with CMU JSGF example Reply To: Enabling JSGF causes an EXC_BAD_ACCESS error

#11688
Jandr50
Participant

After reconfirming how it was supposed to be working, I’ve come to the conclusion it’s unable to parse the grammar file.

I was trying to use the example JSGF example from CMUSphinx’s page, which is

#JSGF V1.0;
grammar samplegrammar;
public = ;
= ;
= /10/ open |/2/ close |/1/ delete |/1/ move;
= [the | a] (window | file | menu);
= (please | kindly | could you | oh mighty computer) *;
= [ please | thanks | thank you ];

and it was throwing an index out of bounds exception. If I change it to a more direct set of phrases

#JSGF V1.0;
grammar samplegrammar;
public =
OPEN THE WINDOW |
CLOSE THE WINDOW |
DELETE THE WINDOW |
DELETE THE FILE |
CLOSE THE FILE;

It seems to work fine. Honestly though, I can probably get away with simple phrase detection like this for this project.

EDIT: the tags were parsing out of the CMU code here, but the example on the page still lists it.