Partager via


Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

Prepare Grammar Error Messages and Format

Prepare Grammar displays error messages and execution summaries in the console. The tool halts execution and displays an error message when it encounters an error that prevents successful completion of a command. The tool returns EXIT_FAILURE (1) when it encounters an error and returns EXIT_SUCCESS (0) when it completes a command successfully. Whether or not a command completes successfully, the tool displays an execution summary after attempting to process a command.

Errors for PrepareGrammar typically will not be for the input file, since it is a binary file that was generated by Compile Grammar. However, Prepare Grammar generates errors for incorrect syntax on the command line and in the speech recognition engine configuration file (see Setting Up the Grammar Development Tools). Execution summaries for Prepare Grammar include the list of properties attributes from the configuration file that were processed successfully.

Remarks

You must either specify a recognition engine configuration file using the /RecoConfig option, or create a default configuration file named "RecoConfig.xml" in the current directory (the directory for the command line), or in the directory that contains PrepareGrammar.exe. The tool will generate an error if you do not supply it with a configuration file.

Example Errors

PrepareGrammar.exe: Error creating reco config object : 'speedvsaccuracy' is an unexpected token. Expecting white space. Line 6, position 22.

Unexpected error occurred when preparing the grammar: Could not find file 'C:\ProgramFiles (x86)\Microsoft Speech Platform SDK\Tools\colpiletest.cfg'.

Example Execution Summaries

PrepareGrammar: preparation for 'preparetest.cfgpp' failed: 3 warnings, 1 errors

Property timeout not yet supported.
Processing completetimeout=0.250000s
Processing incompletetimeout=3s
Processing confidencelevel=0.5
Property sensitivity not yet supported.
Property speedvsaccuracy not yet supported.
Processing requesttimeout=15s
Processing enginerequiredattributes=Language=409;Vendor=Microsoft
Processing engineoptionalattributes=CommandAndControl
PrepareGrammar: 'preparetest.cfgpp' successfully created