2

I am trying to create a custom grammar for a sentence containing a number, e.g. (Revenue increased by 34.5 billion dollars).

A rule that I created using W3C specification looks like:

      <rule id="root" scope="public">  
        <item> <ruleref uri="#subject"/> </item>
        <item> <ruleref uri="#direction"/> </item>
        <item> <ruleref uri="#thenumber"/> </item>  
      </rule>

To pick up the numeric part of the sentence, I want to leverage a built-in type of VoiceXML (e.g.)

<grammar type="application/srgs+xml" src="/grammars/number.grxml"/>

or alternatively use some sort of library for number patterns. The last alternative would be to create a set of rules from scratch to recognize any number.

Any help would be greatly appreciated.

codechobo
  • 829
  • 1
  • 7
  • 12

1 Answers1

1

None of the VoiceXML standard built-in types support natural number input.

Check with your platform or speech recognition vendor. They may offer what you want, which is a natural money grammar (en-US). Alternatively, you can write a natural number grammar. They aren't trivial, but the pattern of input for English isn't too difficult. I've written one before, but I don't own the rights to it. It is a fairly common grammar for most professional services and platform vendors in the speech recognition industry.

Jim Rush
  • 4,143
  • 3
  • 25
  • 27
  • 1
    The VoiceXML standard actually does specify that built-in types are optional. However, it does specify a "number" type specifically for natural number input. As you stated, @codechobo will need to check the documentation for his specific VoiceXML browser and ASR engine, but the major ones I've used all support natural numbers as a built-in type. More info: http://www.w3.org/TR/voicexml20/#dmlABuiltins – Simon Jester Jun 13 '14 at 17:55