Dela via


SrgsGrammarCompiler.Compile Method

Definition

Compiles SrgsDocument objects and XML-format grammar files into binary grammar files with the .cfg extension and sends the output to a stream.

Overloads

Compile(SrgsDocument, Stream)

Compiles an SrgsDocument object into a binary grammar file with the .cfg extension and sends the output to a stream.

Compile(String, Stream)

Compiles an XML-format grammar file into a binary grammar file with the .cfg extension and sends the output to a stream.

Compile(XmlReader, Stream)

Compiles data for an XML-format grammar file referenced by an XmlReader into a binary grammar file with the .cfg extension and sends the output to a stream.

Compile(SrgsDocument, Stream)

Source:
SrgsGrammarCompiler.cs
Source:
SrgsGrammarCompiler.cs
Source:
SrgsGrammarCompiler.cs

Compiles an SrgsDocument object into a binary grammar file with the .cfg extension and sends the output to a stream.

public:
 static void Compile(System::Speech::Recognition::SrgsGrammar::SrgsDocument ^ srgsGrammar, System::IO::Stream ^ outputStream);
public static void Compile (System.Speech.Recognition.SrgsGrammar.SrgsDocument srgsGrammar, System.IO.Stream outputStream);
static member Compile : System.Speech.Recognition.SrgsGrammar.SrgsDocument * System.IO.Stream -> unit
Public Shared Sub Compile (srgsGrammar As SrgsDocument, outputStream As Stream)

Parameters

srgsGrammar
SrgsDocument

The grammar to compile.

outputStream
Stream

The stream that receives the results of compilation.

Exceptions

srgsGrammar is null.

outputStream is null.

Remarks

For more information, see Compile SRGS Grammars.

Applies to

Compile(String, Stream)

Source:
SrgsGrammarCompiler.cs
Source:
SrgsGrammarCompiler.cs
Source:
SrgsGrammarCompiler.cs

Compiles an XML-format grammar file into a binary grammar file with the .cfg extension and sends the output to a stream.

public:
 static void Compile(System::String ^ inputPath, System::IO::Stream ^ outputStream);
public static void Compile (string inputPath, System.IO.Stream outputStream);
static member Compile : string * System.IO.Stream -> unit
Public Shared Sub Compile (inputPath As String, outputStream As Stream)

Parameters

inputPath
String

The path of the file to compile.

outputStream
Stream

The stream that receives the results of compilation.

Exceptions

inputPath is null.

outputStream is null.

inputPath is an empty string.

Remarks

The XML-format grammar file must conform to the Speech Recognition Grammar Specification (SRGS) Version 1.0.

When accessing files, a security check is performed when the file is created or opened. The security check is typically not done again unless the file is closed and reopened.

For more information, see Compile SRGS Grammars.

Applies to

Compile(XmlReader, Stream)

Source:
SrgsGrammarCompiler.cs
Source:
SrgsGrammarCompiler.cs
Source:
SrgsGrammarCompiler.cs

Compiles data for an XML-format grammar file referenced by an XmlReader into a binary grammar file with the .cfg extension and sends the output to a stream.

public:
 static void Compile(System::Xml::XmlReader ^ reader, System::IO::Stream ^ outputStream);
public static void Compile (System.Xml.XmlReader reader, System.IO.Stream outputStream);
static member Compile : System.Xml.XmlReader * System.IO.Stream -> unit
Public Shared Sub Compile (reader As XmlReader, outputStream As Stream)

Parameters

reader
XmlReader

The XmlReader that reads the grammar. The grammar can reside in a physical file or in memory.

outputStream
Stream

The stream that will receive the results of compilation.

Exceptions

reader is null.

outputStream is null.

Remarks

The XML-format grammar file referenced by the XmlReader must conform to the Speech Recognition Grammar Specification (SRGS) Version 1.0.

For more information, see Compile SRGS Grammars.

Applies to