Reply To: changeLanguageModelToFile on JSGF grammars leads to EXC_BAD_ACCESS

Home Forums OpenEars changeLanguageModelToFile on JSGF grammars leads to EXC_BAD_ACCESS Reply To: changeLanguageModelToFile on JSGF grammars leads to EXC_BAD_ACCESS

#1027076
Saliency
Participant

Unfortunately, no, there is no unusual punctuation.

The crash occurs when switching, regardless of whether I start with grammar #1 (which successfully loads initially) and switch to #2, or start with #2 (which also successfully loads initially) and then switch to #1.

Here are the grammars in case you are trying to replicate:


-(void)initializeNormalModel
{
    NSDictionary* grammarDict =  @{
                                   ThisWillBeSaidOnce : @[
                                           @{ OneOfTheseWillBeSaidOnce : @[@"HEY "]},
                                           @{ OneOfTheseWillBeSaidOnce : @[@"WHAT TIME IS IT",
                                                                           @"SWITCH TO MATH GRAMMAR"]}
                                           ]
                                   };
    [self saveGrammar:grammarDict withName:@"normalModel2"];
    
}

-(void)initializeMathModel
{
    NSDictionary* grammarDict =  @{
                                   ThisWillBeSaidOnce : @[
                                           @{ OneOfTheseWillBeSaidOnce : @[@"HEY "]},
                                           @{ OneOfTheseWillBeSaidOnce : @[@"SWITCH TO NORMAL GRAMMAR",
                                                                           @"CALCULATE"
                                                                           ]},
                                           @{ OneOfTheseCanBeSaidWithOptionalRepetitions: @[@"ONE", @"TWO", @"THREE", @"FOUR", @"FIVE", @"SIX", @"SEVEN", @"EIGHT", @"NINE", @"ZERO", @"OH", @"PLUS", @"TIMES", @"POINT"] },
                                           ]
                                   };
    [self saveGrammar:grammarDict withName:@"mathModel2"];
}