1

I can't see where im breaking my jsfg grammar (for Sphinx4). Or is there any debugging tool for parsing?

This compiles:

#JSGF V1.0;

grammar dialog;

<digit> = oh    |
          zero  |
          one   |
          two   |
          three |
          four  |
          five  |
          six   |
          seven |
          eight |
          nine  ;

<number> = <digit>+ [point <digit>+];

<menu_command> =  digits                     |
                  [go to [the]] bank account |
                  weather forecast           |
                  [play] music               |
                  v                          |
                  hud                        |
                  exit [[the] program]       ;

<bank_command> = [show | check] balance |
                 deposit <number>       |
                 withdraw <number>      |
                 back                   ;

<artist_command> =  elvis               |
                    moby                |
                    [the] beatles       |
                    sia                 |       
                    random;

<song_command> =    [a little less] converstion     |
                    moby                |
                    [the] beatles       |
                    sia                 ;

<music_command> = [play] music;

public <command> = <menu_command> | <bank_command>;

But this doesnt:

#JSGF V1.0;

grammar dialog;

<digit> = oh    |
          zero  |
          one   |
          two   |
          three |
          four  |
          five  |
          six   |
          seven |
          eight |
          nine  ;

<number> = <digit>+ [point <digit>+];

<hud_command> = voicehud | hud  

<menu_command> =  digits                     |
                  [go to [the]] bank account |
                  weather forecast           |
                  v                          |
                  hud                        |
                  exit [[the] program]       |
                  hide                       ;

<bank_command> = [show | check] balance |
                 deposit <number>       |
                 withdraw <number>      |
                 back                   ;

<artist_command> =  elvis               |
                    moby                |
                    [the] beatles       |
                    sia                 |       
                    random;

<song_command> =    burning love        |
                    moby                |
                    [the] beatles       |
                    sia                 ;

<album_command> =   [one thousand] forms of fear    |
                    play                            |
                    [the] white album               |
                    burning love                    ;               

<musicapp_command>  = play | music; 

<music_selector_command> = artist | song | album | random | mix;

<music_selection_command> = <artist_command> | <song_command> | <album_command>;    

<music_command> = <musicapp_command><music_selector_command><music_selection_command>;

public <command> = <menu_command> | <bank_command> | <music_command>;
jsky
  • 2,225
  • 5
  • 38
  • 54

0 Answers0