CHMlib Logo Leading Translation Management System for Translation Agencies, Top Translation Management Software for Freelance Translators, Time Tracking Software, Word Count, Character Count and Line Count Software, Computer Assisted Translation Tool for Easy Word Count, Clipboard Character Count Software, User-Friendly Translation Memory Software, Terminology Management Software, Terminology Management Server, Microsoft Glossary Software, Dictionary of Acronyms, Social Network for Translators and Translation Agencies, Acronyms and Abbreviations Search Engine, Russian Translation Lab, Ukrainian Translation Lab.
You are reading help file online using chmlib.com
CrisisHelper - First Aid in Tough Times of World Economic Crisis


The Microsoft.com Speech website Microsoft Speech SDK

SAPI 5.1

Grammar Compiler

The SAPI grammar compiler (gc.exe) creates binary grammars from extensible markup language (XML) defined grammars.

The following topics are discussed in this section:

Introduction

The SAPI grammar compiler is divided into two parts, the front-end section and the back-end section. The front end parses the grammars described in XML and optimizes the XML text formatted grammar if requested by the application. For example, the front end can remove the left recursion. The front end then calls the back-end compiler to convert the internal representation into the SAPI binary format.

return to the top of this pageBack to top

Using the grammar compiler

The SAPI 5 grammar compiler (gc.exe) can be used from the command line, or added to the Microsoft Visual C++ custom build environment.

Using GC from the command line

When compiling XML grammars from the command line, the following options are available:

Command line argument Definition
/O The file name and path information associated with the compiled grammar output file. (CFG)
For example: My_CFG_Grammar.cfg
/H The file name and path information associated with the header file that receives the # define information.
For example: My_Header.h
See specifying the grammar compiler /h option for more information.
file_name.xml The file name and path information associated with the grammar file. (XML)
For example: My_XML_Grammar.xml

return to the top of this pageBack to top

Specifying the grammar compiler /h option

The SAPI grammar compiler can add the XML ID tag NAME and VAL contents to a specified header file. By choosing the /h compile option, the contents of the XML ID tags are added to the specified header file in the standard C-style #define format.


The following illustration shows the result of the /h command line argument while compiling the dictmode.xml file.
Notice the contents of the XML ID tags NAME and VAL are added to the dictmode.h file as c-style #define statements.

return to the top of this pageBack to top

Grammar compiler custom build settings

The SAPI 5 grammar compiler (gc.exe) can be added to the Microsoft Visual C++ custom build environment. The XML grammar compile settings can be pre-configured in the project custom build settings. Each time the XML grammar is compiled, the grammar compiler uses the settings that are specified in the custom build settings.

The Speech SDK 5.1 sample application Dictation Pad illustrates the use of the grammar compiler in the project custom build settings. Compile the dictpad.dsp project and review the Dictation Pad sample application project settings to learn more about how the grammar compiler can be added to the Microsoft Visual C++ custom build environment.
The Dictation Pad SDK sample application can be found in the following location: C:\Program Files\Microsoft Speech SDK5.0\Samples\CPP\DictPad\dictpad.dsp.

Custom build settings

return to the top of this pageBack to top



You are reading help file online using chmlib.com

If you want your help file to be removed or added please send e-mail to chmlibcom@gmail.com
Partner sites: Logo Design, Simple Anti-Crisis Accounting Software, Voice Search for Web