Rule Expansion

  Microsoft Speech Technologies Homepage

Specifies the sets of words or phrases within a rule that are used to match user input. Rule expansions also specify the required sequence of the phrases that are used for input.

XML elements are used to contain user input. The input contained within these elements is known as an alternative. For example, a single word contained in a token element is known as an alternative. A one-of element that contains one or many item elements is an alternative; each item within the set of item elements is also an alternative.

Alternatives can also be thought of as rule expansions. A valid rule expansion is any valid alternative or logical combination of alternatives. A rule expansion is valid if it follows grammar logic.

The following XML elements are used to create rule expansions.

Examples

Example 1

In this example, the word "very" is enclosed by a token element, which is enclosed by an item element, which is enclosed by a one-of element. These three elements are valid rule expansions.

<rule ...>
   <one-of>
      <item repeat="0-1">
         <token>very</token>
      </item>
   </one-of>
</rule>

Example 2

In this example, both ruleref elements are enclosed by item elements, which are enclosed by a one-of element. These three elements are valid rule expansions.

<rule ...>
   <one-of>
      <item repeat="1-3">
         <ruleref uri="#digit"/> 
      </item>
      
      <item repeat="5-">
         <ruleref uri="#date"/>
      </item>
   </one-of>
</rule>

See Also

Grammar XML