JSFG语法没有解析

时间:2015-10-11 12:36:06

标签: grammar cmusphinx sphinx4

我无法看到我在哪里打破我的jsfg语法(对于Sphinx4)。 或者是否有任何用于解析的调试工具?

编译:

#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>;

但这并不是:

#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>;

0 个答案:

没有答案