This topic has not yet been rated - Rate this topic

RecognizedPhrase.ConstructSmlFromSemantics Method

Constructs an object containing a valid Semantic Markup Language (SML) based description of the semantics of a Grammar used to obtain the current instance of RecognizedPhrase.

Namespace: System.Speech.Recognition
Assembly: System.Speech (in system.speech.dll)

public IXPathNavigable ConstructSmlFromSemantics ()
public IXPathNavigable ConstructSmlFromSemantics ()
public function ConstructSmlFromSemantics () : IXPathNavigable
Not applicable.

Return Value

Returns an object implementing the IXPathNavigable interface and containing an SML description of the semantics of the Grammar used to obtain the current

In the example below, the SML returned by ConstructSmlFromSemantics is displayed on a WebBrowser control on a user interface.

internal static void DisplaySemanticsSML(WebBrowser browser, RecognizedPhrase result) {
    if (result.Semantics.Confidence == 1.0 && result.Semantics.Count != 0) { //check for valid semantics
        string temporaryFileName = Path.GetTempPath() + "SML.xml";

        FileStream fs = new FileStream(temporaryFileName, FileMode.Create);
        StreamWriter sw = new StreamWriter(fs);
        sw.Write(result.ConstructSmlFromSemantics().CreateNavigator().OuterXml);
        sw.Close();
        //browser.Scale(new SizeF(.9F,.5F)); //To make it look better
        browser.Navigate(temporaryFileName);

    }
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.