lexicon Element (Microsoft.Speech)

Microsoft Speech Platform SDK 11

Collapse image Expand Image Copy image CopyHover image

Specifies an external pronunciation lexicon file.

Syntax

XML Copy imageCopy Code
<lexicon
    uri = lexiconURI
    type = mediaType />

Attributes

Attribute

Description

uri

Required. Specifies the location of the pronunciation lexicon, which is a relative URI or an absolute URI.

type

Optional. Specifies the media type of the pronunciation lexicon document. Two values are currently supported. The value application/vdn.ms-sapi-lex indicates the lexicon format is Uncompressed Lexicon, a format created by Microsoft. The value application/pls+xml indicates that the lexicon conforms to the Pronunciation Lexicon Specification (PLS) Version 1.0 specification.

Remarks

Lexicons contain the mapping between the pronunciations and the written representations of words or short phrases. You can use lexicons to improve the accuracy of speech recognition or to customize the vocabulary and pronunciations of a synthesized voice.

In Microsoft.Speech, each grammar document can reference only one lexicon. This is a departure from the Speech Recognition Grammar Specification (SRGS) Version 1.0.

The lexicon element must be placed after the opening tag of the grammar element and before the first rule element in the grammar element.

The pronunciation information provided by a lexicon is specific to the single language declared in the xml:lang attribute of the grammar element, and is used only for content defined within the enclosing SRGS document.

Example

XML Copy imageCopy Code
<grammar version="1.0" xml:lang="en-US" tag-format="semantics/1.0"
 xmlns="http://www.w3.org/2001/06/grammar"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.w3.org/2001/06/grammar
                     http://www.w3.org/TR/speech-grammar/grammar.xsd">

    <lexicon uri="http://www.thephone-company.com/lexicon.lex" type="application/vdn.ms-sapi-lex"/>

</grammar>