Share via


Note

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

Grammar Validator Input and Output File Format

Grammar Validator takes as input a grammar (for example a file with a “.grxml” extension) and outputs a set of error and warning messages relevant to the contents of the grammar.

Note

The “.grxml” file extension is an accepted convention for XML-based grammar documents that conform to the Speech Recognition Grammar Specification (SRGS) Version 1.0; however, the extension is not required.

Input File Format

Input files for Grammar Validator must meet the following requirements.

  • The input grammar must conform to the SRGS specification.

  • All ruleref elements must be properly formatted in conformance with the SRGS specification.

A ruleref element contains a link to one of the following:

  • A rule element within the grammar file

  • A rule element in an external grammar file

  • An external grammar file

Grammar Validator processes all external grammars and rules that the input file references.

Grammar rules specify the user input that the speech recognition engine will recognize while the grammar is active. For more information see rule Element (Microsoft.Speech) and ruleref Element (Microsoft.Speech).

Output File Format

Grammar Validator writes its output to the console; it does not create a file. The tool first writes the error messages generated by the input file. For more information, see Grammar Validator Error Messages and Format.

Tool Execution Summary

When the tool finishes validating the input grammar file, it generates an execution summary that contains the numbers of errors and warnings it found during validation, as shown in the following example.

Processing Complete: 5 Error(s). 7 Warning(s).