Note

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

Check Phrase Command-Line Syntax

The command-line syntax for CheckPhrase.exe has the following format.

CheckPhrase /In <input file name> /Phrase <input phrase> /RecoConfig <configuration file name> /Rule <rule ID> /Out <output file name>

The following table describes the command-line option names and values for Check Phrase.

Option Name

Description

/In

Required. The file name and extension of a grammar file. The tool accepts the following file formats: .grxml (grammar XML) and .cfg (compiled grammar). For example "MyGrammar.grxml", or "MyCompiledGrammar.cfg". Input files in other formats will generate an error.

/Phrase

Required. The phrase for which you want to determine whether it exists in the grammar and to receive emulated recognition results. Phrases containing multiple, space-delimited words must be enclosed in parentheses. For example: /Phrase "this phrase".

/RecoConfig

Optional. The name of the configuration file to use for the speech recognition engine. If not specified, the tool will look for a default configuration file named “RecoConfig.xml” in the current working directory and in the directory that contains CheckPhrase.exe. The tool will generate an error if you do not supply it with a configuration file.

/Rule

Optional. The ID of the rule from which analysis should begin. You can use this option for grammars that contain a set of unrelated rules, such as a grammar library. If no rule is specified, the root rule of the grammar is used.

/Out

Optional. The name of the file to which the results will be written. The output file provides more detailed results about grammar parsing than those that are written to the console, including pronunciation of the input phrase that is used in emulation. The output file is in XML format and uses elements optimized to describe utterances. If no file is specified, the tool writes an abbreviated version of the output to the console.

/?

Optional. Displays a list of acceptable option/value pairs.

Note

  • Command-line options and values are not case-sensitive.

  • Command-line options can be preceded by a forward slash (0x002F), a dash (0x002d), an en dash (0x2013), an em dash (0x2014), or a horizontal bar (0x2015).

  • You can enter option/value pairs in any sequence.

Warning

If an existing file has the same name as the file name specified by the /Out option, it will be overwritten. The tool does not warn that a file will be overwritten.

Remarks

To verify whether a phrase with an inline custom pronunciation exists in a grammar, specify the phrase in Display/Lexical/Pronunciation (DLP) format and escape only the first slash. The DLP format lists three forms of a word; display, lexical, and pronunciation, delimited by a forward slash. For most languages, the display form and the lexical form are the same. The pronunciation form should contain characters from a phonetic alphabet that the Speech Platform supports, preferably the Universal Phone Set (UPS). See Phonetic Alphabet Reference (Microsoft.Speech) for more information. Here is an example command-line entry that checks a grammar for the presence of a word that has a custom pronunciation:

CheckPhrase.exe -In CustomPronunciations.grxml -Phrase "//tomato/tomato/T AX . S1 M AA . DX O" -Out OutputPhrases.utt

You must either specify a recognition engine configuration file using the /RecoConfig option, or create a default configuration file named "RecoConfig.xml" either in the current directory (the directory for the command line) or in the directory that contains CheckPhrase.exe. Use the configuration file to specify a speech recognition engine to use, to configure the parameters for connecting to it, and to configure its behavior. For more information, see Setting Up the Grammar Development Tools.