Freigeben über


ConfirmByOmission Property

  Microsoft Speech Technologies Homepage

Gets or sets whether user silence is treated as confirmation of multiple items. Read/write.

Usage

ASP.NET markup: <speech:QA ConfirmByOmission="..." />
Get value: Boolean = QA.ConfirmByOmission;
Set value: QA.ConfirmByOmission = Boolean;
Data type: System.Boolean
Required: No; Default: True

Remarks

In the default style of data confirmation, data elements that require confirmation must be explicitly confirmed or corrected by the user. The ConfirmByOmission property enables a style of confirmation in which any item not explicitly corrected by the user is confirmed.

Example

The following example demonstrates how two QA controls collect the origin and destination of a flight, and a third QA performs confirmation. The grammar must be able to recognize words such as "from" and "to" in order to distinguish the origin and destination cities.

The ConfirmByOmission property is significant when the third QA asks the user to confirm a request for a flight from Burbank to Seattle, and recognizes the user's response as "From Los Angeles." If ConfirmByOmission is True, then the originating city is confirmed because of the correction, and the destination city is confirmed by the absence of a correction. If ConfirmByOmission is False, then the originating city is confirmed because of the correction, and the confirmation process will ask the user for confirmation of a request for a flight from Los Angeles to Seattle.

<form id="Form1" method="post" runat="server">
  ...
  <speech:qa id="qaOrig" runat="server">
    <Prompt id="prompt1" InlinePrompt="What is your originating city?"></Prompt>
    <Reco id="recoOrig">
      <Grammars>
        <speech:grammar src="grammars/cities.xml" runat="server"></speech:grammar>
      </Grammars>
    </Reco>
    <Answers>
      <speech:answer id="ansOrig" XPathTrigger="/sml/origcity" SemItem="siOrig" runat="server">
      </speech:answer>
    </Answers>
  </speech:qa>
  
  <speech:qa id="qaDest" runat="server">
    <Prompt id="prompt1" InlinePrompt="What is your destination city?"></Prompt>
    <Reco id="recoDest">
      <Grammars>
        <speech:grammar src="grammars/cities.xml" runat="server"></speech:grammar>
      </Grammars>
    </Reco>
    <Answers>
      <speech:answer id="ansDest" XPathTrigger="/sml/destcity" SemItem="siDest" runat="server">
      </speech:answer>
    </Answers>
  </speech:qa>
  
  <speech:qa id="qaConf" ConfirmByOmission="True" xpathDenyConfirms="/sml/deny" xpathAcceptConfirms="/sml/accept runat="server" ">
    <Prompt id="promptConf" PromptSelectFunction="promptSelection"></Prompt>
    <Reco id="recoConf">
      <Grammars>
        <speech:grammar src="grammars/cities.xml" runat="server"></speech:grammar>
      </Grammars>
    </Reco>
    <Confirms>
      <speech:answer id="confOrig" XPathTrigger="/sml/origcity" SemItem="siOrig" runat="server">
      </speech:answer>
      <speech:answer id="confDest" XPathTrigger="/sml/destcity" SemItem="siDest" runat="server">
      </speech:answer>
    </Confirms>
  </speech:qa>
  
  <script>
  function promptSelection ()
  {
    var myPrompt = "please confirm that you wish to fly from ";
    myPrompt = myPrompt + RunSpeech.GetSemanticItem("siOrig").value + " to ";
    myPrompt = myPrompt + RunSpeech.GetSemanticItem("siDest").value + ". ";
    return myPrompt;
  }
  </script>
  ...
</form>

See Also

QA Class | QA Constructor | QA Members | QA Properties | QA Methods | QA Events | QA Remarks | QA Client Object