Click here to Skip to main content
15,883,883 members
Articles / Programming Languages / C#

Writing SAPI 5.1 Apps in CSharp

Rate me:
Please Sign up or sign in to vote.
2.71/5 (4 votes)
10 Feb 20063 min read 65.5K   1.3K   36  
Simple CSharp program that showcases basic SR and TTS features of SAPI 5.1
<?xml version="1.0" encoding="utf-8" ?>
<GRAMMAR LANGID="409">
<RULE TOPLEVEL="ACTIVE"  ID="1">
  <L PROPNAME="request" >
    <P VALSTR ="looking">I am looking for</P>
    <P VALSTR ="cani">Can I have</P>
    <P VALSTR ="please">Please tell me</P>
    <P VALSTR ="canyoutel">Can you tell me</P>
    <P VALSTR ="doyou">Do you have</P>
    <P VALSTR ="what">What is</P>
    <P VALSTR ="need">I need</P>
  </L> 
  <RULEREF NAME = "goal" />
  <RULEREF NAME = "subject" />
  <RULEREF NAME = "location" />
 </RULE>
  
<RULE NAME ="goal" >
  <RULEREF NAME ="determiner" />
  
  <L PROPNAME="phoneoraddress">
    <P VALSTR="phone">Phone Number OF</P>
    <P VALSTR="address">Address OF</P>
    <P VALSTR="address">Location OF</P>
    <P VALSTR="phone">Contact Info OF</P>
    <P VALSTR="address">Nearest</P>

  </L>
 </RULE >

  <RULE NAME ="subject">
    <RULEREF NAME="determiner"></RULEREF>
    <DICTATION PROPNAME="dobject" MIN="1" MAX="4"></DICTATION>
  </RULE>
  
  <RULE NAME ="determiner" >
    <O>
      <L PROPNAME="pdetermener">
        <P VALSTR="a">a</P>
        <P VALSTR="an">an</P>
        <P VALSTR="the">the</P>
      </L>  
    </O>
    
  </RULE>
  
  <RULE NAME="location">
    <RULEREF NAME="particle"></RULEREF>
    <DICTATION PROPNAME="dlocation" MIN="1" MAX="5"></DICTATION>
  </RULE>
  
  <RULE NAME="particle">
    <L PROPNAME="lparticle">
      <P VALSTR="on">on</P>
      <P VALSTR="around">around</P>
      <P VALSTR="near">near</P>
      <P VALSTR="in">in</P>
      <P VALSTR="to">to</P>

    </L>
  </RULE>
</GRAMMAR>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
Got my BS in CompSci '95 and MS in '98, have been developing in viraety of languages including though primarely with Java and C. Latest interest is SAPI and verious speech applications.

Comments and Discussions