1

我正在使用以下语法:

#JSGF V1.0;


 public <basicCmd> = <startPolite> <command> <endPolite>;
  <command> = <action> <object>;
  <action> = /10/ open |/2/ close |/1/ delete |/1/ move;
  <object> = [the | a] (window | file | menu);
  <startPolite> = (please | kindly | could you | oh mighty computer) *;
  <endPolite> = [ please | thanks | thank you ];

我从Sphinx JSGF 教程中复制了这个。并保存为 main.gram 。

每当我使用以下命令启动 pocketsphinx 时:

pocketsphinx_continuous -inmic yes -jsgf main.gram

我收到以下错误:

ERROR: "jsgf_parser.y", line 155: syntax error, unexpected PUBLIC, expecting GRAMMAR at line 2 current token 'public'
ERROR: "jsgf.c", line 904: Failed to parse JSGF grammar from 'main.gram'

我认为语法是正确的,并且我正确传递了所需的参数。可能是什么问题呢?请帮忙!

4

1 回答 1

1

我想到了!。问题是我没有包含语法声明。

grammar sample;

#JSGF V1.0;

于 2015-05-10T12:55:03.533 回答