Question

we would like to use an XML file for the grammar, to list all the commands for our system,

however, one of the commands will be "find user xxxxxx" where xxxxx will be a unique number.

If there a way within the grammar xml file to create this "wildcard / search item"

Was it helpful?

Solution

Try using a combination of two rules in your grxml file.

First rule to accept individual numbers:

  <rule id="SmallNum" scope="public">
    <one-of>
      <item>One</item>
      <item>Two</item>
      <item>Three</item>
      <item>Four</item>
      <item>Five</item>
      <item>Six</item>
      <item>Seven</item>
      <item>Eight</item>
      <item>Nine</item>
      <item>Zero</item>
    </one-of>
  </rule>

Second rule to build an account number from a specified number of numbers:

  <rule id="AccountNumber" scope="public">
    <item repeat="0-1">AccountNumber</item>
    <item   repeat="3">
      <ruleref uri="#SmallNum"/>
    </item>
  </rule>

OTHER TIPS

what you ask is possible... there are various ways to do this...

The better way would be writing some kind of intelligence using machine learning methodologies, but I suspect you don't want to go so far, so I suggest "teaching" number dictation and use SpeechHypothesized event (I comment this in the other post 'cause I suspected you would need it) to combine words.

Also good for you:

http://msdn.microsoft.com/en-us/library/ms873284.aspx (Build Knowledge)

and

http://msdn.microsoft.com/en-us/library/system.speech.recognition.speechrecognitionengine.speechhypothesized(v=vs.110).aspx

Good luck

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top