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"

Était-ce utile?

La 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>

Autres conseils

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top