GotSpeech.NET

The online community for Microsoft Speech Server developers
Welcome to GotSpeech.NET Sign in | Join | Help
in Search
Computer-Talk

Dictation within a context-free grammar

Last post 04-29-2008, 11:02 AM by slikrik. 0 replies.
Sort Posts: Previous Next
  •  04-29-2008, 11:02 AM 5375

    Dictation within a context-free grammar

    Greetings,

    I am trying to assemble a fairly simple grammar (see XML below) for speech recognition, and the format of my grammar is as follows:

    "order sell [quantity] at [price]"          (or)
    "order pay [price] on [quantity]"

    Where quantity is some integer value and price is some floating-point value, and both are "dictation" elements where I rely on the SAPI dictation engine to decipher the numbers in this case.

    I would like the engine to normalize these dictation elements, so that if I say "three hundred and nineteen" or "three point four" it will automatically normalize the text into 319 and 3.4, respectively.  The SAPI engine *will* do this if I simply load a grammar and call DictationLoad or DictationSetState = Active, however if I have Dictation rules embedded within a context-free grammar I'm defining, it will not do this text replacement/normalization.

    So if I say:

    "order sell three hundred and nineteen at forty five point five"

    what I want is:

    "order sell 319 at 45.5"

    How can I get the reco engine to perform this normalization *within* my grammar at these dictation points?  If there's no automatic way to do this, is there a way to get the text for the two dictation elements of the Recognition phrase (e.g. "three hundred and nineteen") and feed these into an SAPI translation procedure to do the replacement for me?

    Thanks,
    Rick

    My grammar:

    <GRAMMAR LANGID="409">
      <RULE TOPLEVEL="ACTIVE"  ID="1">
        <PHRASE>order</PHRASE>
        <RULEREF NAME = "OrderRule" />
      </RULE>
     
      <RULE NAME="OrderRule"  ID="2">
        <O>
          <PHRASE>sell</PHRASE>
          <RULEREF NAME = "quantity" />
          <PHRASE>at</PHRASE>
          <RULEREF NAME = "price" />
        </O>

        <O>
          <PHRASE>pay</PHRASE>
          <RULEREF NAME = "price" />
          <PHRASE>on</PHRASE>
          <RULEREF NAME = "quantity" />
        </O> 
    </RULE>
     
      <RULE NAME="quantity">
        <DICTATION PROPNAME="dQuantity" MIN="1" MAX="5"></DICTATION>
      </RULE>
      <RULE NAME="price">
        <DICTATION PROPNAME="dPrice" MIN="1" MAX="5"></DICTATION>
      </RULE>
    </GRAMMAR>
View as RSS news feed in XML