Industry grammars - Amazon Lex

Industry grammars

Industry grammars are a set of XML files to use with the grammar slot type. You can use these to quickly deliver a consistent end-user experience as you migrate interactive voice response work flows to Amazon Lex V2. You can select from a range of pre-built grammars across three domains: financial services, insurance, and telecom. There is also a generic set of grammars that you can use as a starting point for your own grammars.

The grammars contain the rules to collect the information and the ECMAScript tags for semantic interpretation.

Grammars for financial services (download)

The following grammars are supported for financial services: account and routing numbers, credit card and loan numbers, credit score, account opening and closing dates, and Social Security number.

<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My account number is A B C 1 2 3 4 Output: ABC1234 Scenario 2: Input: My account number is 1 2 3 4 A B C Output: 1234ABC Scenario 3: Input: Hmm My account number is 1 2 3 4 A B C 1 Output: 123ABC1 --> <rule id="main" scope="public"> <tag>out=""</tag> <item><ruleref uri="#alphanumeric"/><tag>out += rules.alphanumeric.alphanum;</tag></item> <item repeat="0-1"><ruleref uri="#alphabets"/><tag>out += rules.alphabets.letters;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits.numbers</tag></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">account number is</item> <item repeat="0-1">Account Number</item> <item repeat="0-1">Here is my Account Number </item> <item repeat="0-1">Yes, It is</item> <item repeat="0-1">Yes It is</item> <item repeat="0-1">Yes It's</item> <item repeat="0-1">My account Id is</item> <item repeat="0-1">This is the account Id</item> <item repeat="0-1">account Id</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="alphanumeric" scope="public"> <tag>out.alphanum=""</tag> <item><ruleref uri="#alphabets"/><tag>out.alphanum += rules.alphabets.letters;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.alphanum += rules.digits.numbers</tag></item> </rule> <rule id="alphabets"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.letters=""</tag> <tag>out.firstOccurence=""</tag> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.firstOccurence += rules.digits.numbers; out.letters += out.firstOccurence;</tag></item> <item repeat="1-"> <one-of> <item>A<tag>out.letters+='A';</tag></item> <item>B<tag>out.letters+='B';</tag></item> <item>C<tag>out.letters+='C';</tag></item> <item>D<tag>out.letters+='D';</tag></item> <item>E<tag>out.letters+='E';</tag></item> <item>F<tag>out.letters+='F';</tag></item> <item>G<tag>out.letters+='G';</tag></item> <item>H<tag>out.letters+='H';</tag></item> <item>I<tag>out.letters+='I';</tag></item> <item>J<tag>out.letters+='J';</tag></item> <item>K<tag>out.letters+='K';</tag></item> <item>L<tag>out.letters+='L';</tag></item> <item>M<tag>out.letters+='M';</tag></item> <item>N<tag>out.letters+='N';</tag></item> <item>O<tag>out.letters+='O';</tag></item> <item>P<tag>out.letters+='P';</tag></item> <item>Q<tag>out.letters+='Q';</tag></item> <item>R<tag>out.letters+='R';</tag></item> <item>S<tag>out.letters+='S';</tag></item> <item>T<tag>out.letters+='T';</tag></item> <item>U<tag>out.letters+='U';</tag></item> <item>V<tag>out.letters+='V';</tag></item> <item>W<tag>out.letters+='W';</tag></item> <item>X<tag>out.letters+='X';</tag></item> <item>Y<tag>out.letters+='Y';</tag></item> <item>Z<tag>out.letters+='Z';</tag></item> </one-of> </item> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.numbers=""</tag> <item repeat="1-10"> <one-of> <item>0<tag>out.numbers+=0;</tag></item> <item>1<tag>out.numbers+=1;</tag></item> <item>2<tag>out.numbers+=2;</tag></item> <item>3<tag>out.numbers+=3;</tag></item> <item>4<tag>out.numbers+=4;</tag></item> <item>5<tag>out.numbers+=5;</tag></item> <item>6<tag>out.numbers+=6;</tag></item> <item>7<tag>out.numbers+=7;</tag></item> <item>8<tag>out.numbers+=8;</tag></item> <item>9<tag>out.numbers+=9;</tag></item> </one-of> </item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="digits" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My routing number is 1 2 3 4 5 6 7 8 9 Output: 123456789 Scenario 2: Input: routing number 1 2 3 4 5 6 7 8 9 Output: 123456789 --> <rule id="digits"> <tag>out=""</tag> <item><ruleref uri="#singleDigit"/><tag>out += rules.singleDigit.digit;</tag></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My routing number</item> <item repeat="0-1">Routing number of</item> <item repeat="0-1">The routing number is</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="singleDigit"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.digit=""</tag> <item repeat="16"> <one-of> <item>0<tag>out.digit+=0;</tag></item> <item>zero<tag>out.digit+=0;</tag></item> <item>1<tag>out.digit+=1;</tag></item> <item>one<tag>out.digit+=1;</tag></item> <item>2<tag>out.digit+=2;</tag></item> <item>two<tag>out.digit+=2;</tag></item> <item>3<tag>out.digit+=3;</tag></item> <item>three<tag>out.digit+=3;</tag></item> <item>4<tag>out.digit+=4;</tag></item> <item>four<tag>out.digit+=4;</tag></item> <item>5<tag>out.digit+=5;</tag></item> <item>five<tag>out.digit+=5;</tag></item> <item>6<tag>out.digit+=6;</tag></item> <item>six<tag>out.digit+=5;</tag></item> <item>7<tag>out.digit+=7;</tag></item> <item>seven<tag>out.digit+=7;</tag></item> <item>8<tag>out.digit+=8;</tag></item> <item>eight<tag>out.digit+=8;</tag></item> <item>9<tag>out.digit+=9;</tag></item> <item>nine<tag>out.digit+=9;</tag></item> </one-of> </item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="digits" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My credit card number is 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 Output: 1234567891234567 Scenario 2: Input: card number 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 Output: 1234567891234567 --> <rule id="digits"> <tag>out=""</tag> <item><ruleref uri="#singleDigit"/><tag>out += rules.singleDigit.digit;</tag></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My credit card number is</item> <item repeat="0-1">card number</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="singleDigit"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.digit=""</tag> <item repeat="16"> <one-of> <item>0<tag>out.digit+=0;</tag></item> <item>zero<tag>out.digit+=0;</tag></item> <item>1<tag>out.digit+=1;</tag></item> <item>one<tag>out.digit+=1;</tag></item> <item>2<tag>out.digit+=2;</tag></item> <item>two<tag>out.digit+=2;</tag></item> <item>3<tag>out.digit+=3;</tag></item> <item>three<tag>out.digit+=3;</tag></item> <item>4<tag>out.digit+=4;</tag></item> <item>four<tag>out.digit+=4;</tag></item> <item>5<tag>out.digit+=5;</tag></item> <item>five<tag>out.digit+=5;</tag></item> <item>6<tag>out.digit+=6;</tag></item> <item>six<tag>out.digit+=5;</tag></item> <item>7<tag>out.digit+=7;</tag></item> <item>seven<tag>out.digit+=7;</tag></item> <item>8<tag>out.digit+=8;</tag></item> <item>eight<tag>out.digit+=8;</tag></item> <item>9<tag>out.digit+=9;</tag></item> <item>nine<tag>out.digit+=9;</tag></item> </one-of> </item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My loan Id is A B C 1 2 3 4 Output: ABC1234 --> <rule id="main" scope="public"> <tag>out=""</tag> <item><ruleref uri="#alphanumeric"/><tag>out += rules.alphanumeric.alphanum;</tag></item> <item repeat="0-1"><ruleref uri="#alphabets"/><tag>out += rules.alphabets.letters;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits.numbers</tag></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">my loan number is</item> <item repeat="0-1">The loan number</item> <item repeat="0-1">The loan is </item> <item repeat="0-1">The number is</item> <item repeat="0-1">loan number</item> <item repeat="0-1">loan number of</item> <item repeat="0-1">loan Id is</item> <item repeat="0-1">My loan Id is</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="alphanumeric" scope="public"> <tag>out.alphanum=""</tag> <item><ruleref uri="#alphabets"/><tag>out.alphanum += rules.alphabets.letters;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.alphanum += rules.digits.numbers</tag></item> </rule> <rule id="alphabets"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.letters=""</tag> <tag>out.firstOccurence=""</tag> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.firstOccurence += rules.digits.numbers; out.letters += out.firstOccurence;</tag></item> <item repeat="1-"> <one-of> <item>A<tag>out.letters+='A';</tag></item> <item>B<tag>out.letters+='B';</tag></item> <item>C<tag>out.letters+='C';</tag></item> <item>D<tag>out.letters+='D';</tag></item> <item>E<tag>out.letters+='E';</tag></item> <item>F<tag>out.letters+='F';</tag></item> <item>G<tag>out.letters+='G';</tag></item> <item>H<tag>out.letters+='H';</tag></item> <item>I<tag>out.letters+='I';</tag></item> <item>J<tag>out.letters+='J';</tag></item> <item>K<tag>out.letters+='K';</tag></item> <item>L<tag>out.letters+='L';</tag></item> <item>M<tag>out.letters+='M';</tag></item> <item>N<tag>out.letters+='N';</tag></item> <item>O<tag>out.letters+='O';</tag></item> <item>P<tag>out.letters+='P';</tag></item> <item>Q<tag>out.letters+='Q';</tag></item> <item>R<tag>out.letters+='R';</tag></item> <item>S<tag>out.letters+='S';</tag></item> <item>T<tag>out.letters+='T';</tag></item> <item>U<tag>out.letters+='U';</tag></item> <item>V<tag>out.letters+='V';</tag></item> <item>W<tag>out.letters+='W';</tag></item> <item>X<tag>out.letters+='X';</tag></item> <item>Y<tag>out.letters+='Y';</tag></item> <item>Z<tag>out.letters+='Z';</tag></item> </one-of> </item> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.numbers=""</tag> <item repeat="1-10"> <one-of> <item>0<tag>out.numbers+=0;</tag></item> <item>1<tag>out.numbers+=1;</tag></item> <item>2<tag>out.numbers+=2;</tag></item> <item>3<tag>out.numbers+=3;</tag></item> <item>4<tag>out.numbers+=4;</tag></item> <item>5<tag>out.numbers+=5;</tag></item> <item>6<tag>out.numbers+=6;</tag></item> <item>7<tag>out.numbers+=7;</tag></item> <item>8<tag>out.numbers+=8;</tag></item> <item>9<tag>out.numbers+=9;</tag></item> </one-of> </item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: The number is fifteen Output: 15 Scenario 2: Input: My credit score is fifteen Output: 15 --> <rule id="main" scope="public"> <tag>out=""</tag> <one-of> <item repeat="1"><ruleref uri="#digits"/><tag>out+= rules.digits;</tag></item> <item repeat="1"><ruleref uri="#teens"/><tag>out+= rules.teens;</tag></item> <item repeat="1"><ruleref uri="#above_twenty"/><tag>out+= rules.above_twenty;</tag></item> </one-of> </rule> <rule id="text"> <one-of> <item repeat="0-1">Credit score is</item> <item repeat="0-1">Last digits are</item> <item repeat="0-1">The number is</item> <item repeat="0-1">That's</item> <item repeat="0-1">It is</item> <item repeat="0-1">My credit score is</item> </one-of> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>0<tag>out=0;</tag></item> <item>1<tag>out=1;</tag></item> <item>2<tag>out=2;</tag></item> <item>3<tag>out=3;</tag></item> <item>4<tag>out=4;</tag></item> <item>5<tag>out=5;</tag></item> <item>6<tag>out=6;</tag></item> <item>7<tag>out=7;</tag></item> <item>8<tag>out=8;</tag></item> <item>9<tag>out=9;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>ten<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> <item>10<tag>out=10;</tag></item> <item>11<tag>out=11;</tag></item> <item>12<tag>out=12;</tag></item> <item>13<tag>out=13;</tag></item> <item>14<tag>out=14;</tag></item> <item>15<tag>out=15;</tag></item> <item>16<tag>out=16;</tag></item> <item>17<tag>out=17;</tag></item> <item>18<tag>out=18;</tag></item> <item>19<tag>out=19;</tag></item> </one-of> </rule> <rule id="above_twenty"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> <item>forty<tag>out=40;</tag></item> <item>fifty<tag>out=50;</tag></item> <item>sixty<tag>out=60;</tag></item> <item>seventy<tag>out=70;</tag></item> <item>eighty<tag>out=80;</tag></item> <item>ninety<tag>out=90;</tag></item> <item>20<tag>out=20;</tag></item> <item>30<tag>out=30;</tag></item> <item>40<tag>out=40;</tag></item> <item>50<tag>out=50;</tag></item> <item>60<tag>out=60;</tag></item> <item>70<tag>out=70;</tag></item> <item>80<tag>out=80;</tag></item> <item>90<tag>out=90;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: I opened account on July Two Thousand and Eleven Output: 07/11 Scenario 2: Input: I need account number opened on July Two Thousand and Eleven Output: 07/11 --> <rule id="main" scope="public"> <tag>out=""</tag> <item repeat="1-10"> <item repeat="1"><ruleref uri="#months"/><tag>out = out + rules.months.mon + "/";</tag></item> <one-of> <item><ruleref uri="#thousands"/><tag>out += rules.thousands;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty;</tag></item> </one-of> </item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">I opened account on </item> <item repeat="0-1">I need account number opened on </item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="months"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.mon=""</tag> <one-of> <item>january<tag>out.mon+="01";</tag></item> <item>february<tag>out.mon+="02";</tag></item> <item>march<tag>out.mon+="03";</tag></item> <item>april<tag>out.mon+="04";</tag></item> <item>may<tag>out.mon+="05";</tag></item> <item>june<tag>out.mon+="06";</tag></item> <item>july<tag>out.mon+="07";</tag></item> <item>august<tag>out.mon+="08";</tag></item> <item>september<tag>out.mon+="09";</tag></item> <item>october<tag>out.mon+="10";</tag></item> <item>november<tag>out.mon+="11";</tag></item> <item>december<tag>out.mon+="12";</tag></item> <item>jan<tag>out.mon+="01";</tag></item> <item>feb<tag>out.mon+="02";</tag></item> <item>aug<tag>out.mon+="08";</tag></item> <item>sept<tag>out.mon+="09";</tag></item> <item>oct<tag>out.mon+="10";</tag></item> <item>nov<tag>out.mon+="11";</tag></item> <item>dec<tag>out.mon+="12";</tag></item> </one-of> </rule> <rule id="digits"> <one-of> <item>zero<tag>out=0;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <one-of> <item>ten<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> </one-of> </rule> <rule id="thousands"> <item>two thousand<!--<tag>out=2000;</tag>--></item> <item repeat="0-1">and</item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out = rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out = rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out = rules.above_twenty;</tag></item> </rule> <rule id="above_twenty"> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> <item>forty<tag>out=40;</tag></item> <item>fifty<tag>out=50;</tag></item> <item>sixty<tag>out=60;</tag></item> <item>seventy<tag>out=70;</tag></item> <item>eighty<tag>out=80;</tag></item> <item>ninety<tag>out=90;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: I want to schedule auto pay for twenty five Dollar Output: $25 Scenario 2: Input: Setup automatic payments for twenty five dollars Output: $25 --> <rule id="main" scope="public"> <tag>out="$"</tag> <one-of> <item><ruleref uri="#sub_hundred"/><tag>out += rules.sub_hundred.sh;</tag></item> <item><ruleref uri="#subThousands"/><tag>out += rules.subThousands;</tag></item> </one-of> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">I want to schedule auto pay for</item> <item repeat="0-1">Setup automatic payments for twenty five dollars</item> <item repeat="0-1">Auto pay amount of</item> <item repeat="0-1">Set it up for</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.num = 0;</tag> <one-of> <item>0<tag>out.num+=0;</tag></item> <item>1<tag>out.num+=1;</tag></item> <item>2<tag>out.num+=2;</tag></item> <item>3<tag>out.num+=3;</tag></item> <item>4<tag>out.num+=4;</tag></item> <item>5<tag>out.num+=5;</tag></item> <item>6<tag>out.num+=6;</tag></item> <item>7<tag>out.num+=7;</tag></item> <item>8<tag>out.num+=8;</tag></item> <item>9<tag>out.num+=9;</tag></item> <item>one<tag>out.num+=1;</tag></item> <item>two<tag>out.num+=2;</tag></item> <item>three<tag>out.num+=3;</tag></item> <item>four<tag>out.num+=4;</tag></item> <item>five<tag>out.num+=5;</tag></item> <item>six<tag>out.num+=6;</tag></item> <item>seven<tag>out.num+=7;</tag></item> <item>eight<tag>out.num+=8;</tag></item> <item>nine<tag>out.num+=9;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> <rule id="teens"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.teen = 0;</tag> <one-of> <item>ten<tag>out.teen+=10;</tag></item> <item>eleven<tag>out.teen+=11;</tag></item> <item>twelve<tag>out.teen+=12;</tag></item> <item>thirteen<tag>out.teen+=13;</tag></item> <item>fourteen<tag>out.teen+=14;</tag></item> <item>fifteen<tag>out.teen+=15;</tag></item> <item>sixteen<tag>out.teen+=16;</tag></item> <item>seventeen<tag>out.teen+=17;</tag></item> <item>eighteen<tag>out.teen+=18;</tag></item> <item>nineteen<tag>out.teen+=19;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> <rule id="above_twenty"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.tens = 0;</tag> <one-of> <item>twenty<tag>out.tens+=20;</tag></item> <item>thirty<tag>out.tens+=30;</tag></item> <item>forty<tag>out.tens+=40;</tag></item> <item>fifty<tag>out.tens+=50;</tag></item> <item>sixty<tag>out.tens+=60;</tag></item> <item>seventy<tag>out.tens+=70;</tag></item> <item>eighty<tag>out.tens+=80;</tag></item> <item>ninety<tag>out.tens+=90;</tag></item> <item>hundred<tag>out.tens+=100;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.tens += rules.digits.num;</tag></item> </rule> <rule id="currency"> <one-of> <item repeat="0-1">dollars</item> <item repeat="0-1">Dollars</item> <item repeat="0-1">dollar</item> <item repeat="0-1">Dollar</item> </one-of> </rule> <rule id="sub_hundred"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.sh = 0;</tag> <one-of> <item><ruleref uri="#teens"/><tag>out.sh += rules.teens.teen;</tag></item> <item> <ruleref uri="#above_twenty"/><tag>out.sh += rules.above_twenty.tens;</tag> </item> <item><ruleref uri="#digits"/><tag>out.sh += rules.digits.num;</tag></item> </one-of> </rule> <rule id="subThousands"> <ruleref uri="#sub_hundred"/><tag>out = (100 * rules.sub_hundred.sh);</tag> hundred <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty.tens;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens.teen;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits.num;</tag></item> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="dateCardExpiration" mode="voice" tag-format="semantics/1.0"> <rule id="dateCardExpiration" scope="public"> <tag>out=""</tag> <item repeat="1"><ruleref uri="#months"/><tag>out = out + rules.months;</tag></item> <item repeat="1"><ruleref uri="#year"/><tag>out += " " + rules.year.yr;</tag></item> </rule> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My card expiration date is july eleven Output: 07 2011 Scenario 2: Input: My card expiration date is may twenty six Output: 05 2026 --> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My card expiration date is </item> <item repeat="0-1">Expiration date is </item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="months"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>january<tag>out="01";</tag></item> <item>february<tag>out="02";</tag></item> <item>march<tag>out="03";</tag></item> <item>april<tag>out="04";</tag></item> <item>may<tag>out="05";</tag></item> <item>june<tag>out="06";</tag></item> <item>july<tag>out="07";</tag></item> <item>august<tag>out="08";</tag></item> <item>september<tag>out="09";</tag></item> <item>october<tag>out="10";</tag></item> <item>november<tag>out="11";</tag></item> <item>december<tag>out="12";</tag></item> <item>jan<tag>out="01";</tag></item> <item>feb<tag>out="02";</tag></item> <item>aug<tag>out="08";</tag></item> <item>sept<tag>out="09";</tag></item> <item>oct<tag>out="10";</tag></item> <item>nov<tag>out="11";</tag></item> <item>dec<tag>out="12";</tag></item> <item>1<tag>out="01";</tag></item> <item>2<tag>out="02";</tag></item> <item>3<tag>out="03";</tag></item> <item>4<tag>out="04";</tag></item> <item>5<tag>out="05";</tag></item> <item>6<tag>out="06";</tag></item> <item>7<tag>out="07";</tag></item> <item>8<tag>out="08";</tag></item> <item>9<tag>out="09";</tag></item> <item>ten<tag>out="10";</tag></item> <item>eleven<tag>out="11";</tag></item> <item>twelve<tag>out="12";</tag></item> </one-of> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>0<tag>out=0;</tag></item> <item>1<tag>out=1;</tag></item> <item>2<tag>out=2;</tag></item> <item>3<tag>out=3;</tag></item> <item>4<tag>out=4;</tag></item> <item>5<tag>out=5;</tag></item> <item>6<tag>out=6;</tag></item> <item>7<tag>out=7;</tag></item> <item>8<tag>out=8;</tag></item> <item>9<tag>out=9;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="year"> <tag>out.yr="20"</tag> <one-of> <item><ruleref uri="#teens"/><tag>out.yr += rules.teens;</tag></item> <item><ruleref uri="#above_twenty"/><tag>out.yr += rules.above_twenty;</tag></item> </one-of> </rule> <rule id="teens"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>ten<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> <item>10<tag>out=10;</tag></item> <item>11<tag>out=11;</tag></item> <item>12<tag>out=12;</tag></item> <item>13<tag>out=13;</tag></item> <item>14<tag>out=14;</tag></item> <item>15<tag>out=15;</tag></item> <item>16<tag>out=16;</tag></item> <item>17<tag>out=17;</tag></item> <item>18<tag>out=18;</tag></item> <item>19<tag>out=19;</tag></item> </one-of> </rule> <rule id="above_twenty"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> <item>forty<tag>out=40;</tag></item> <item>fifty<tag>out=50;</tag></item> <item>sixty<tag>out=60;</tag></item> <item>seventy<tag>out=70;</tag></item> <item>eighty<tag>out=80;</tag></item> <item>ninety<tag>out=90;</tag></item> <item>20<tag>out=20;</tag></item> <item>30<tag>out=30;</tag></item> <item>40<tag>out=40;</tag></item> <item>50<tag>out=50;</tag></item> <item>60<tag>out=60;</tag></item> <item>70<tag>out=70;</tag></item> <item>80<tag>out=80;</tag></item> <item>90<tag>out=90;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: Show me statements from July Five Two Thousand and Eleven Output: 07/5/11 Scenario 2: Input: Show me statements from July Sixteen Two Thousand and Eleven Output: 07/16/11 Scenario 3: Input: Show me statements from July Thirty Two Thousand and Eleven Output: 07/30/11 --> <rule id="main" scope="public"> <tag>out=""</tag> <item> <item repeat="1"><ruleref uri="#months"/><tag>out = out + rules.months.mon + "/";</tag></item> <one-of> <item><ruleref uri="#digits"/><tag>out += rules.digits + "/";</tag></item> <item><ruleref uri="#teens"/><tag>out += rules.teens+ "/";</tag></item> <item><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty+ "/";</tag></item> </one-of> <one-of> <item><ruleref uri="#thousands"/><tag>out += rules.thousands;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty;</tag></item> </one-of> </item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">I want to see bank statements from </item> <item repeat="0-1">Show me statements from</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="months"> <tag>out.mon=""</tag> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>january<tag>out.mon+="01";</tag></item> <item>february<tag>out.mon+="02";</tag></item> <item>march<tag>out.mon+="03";</tag></item> <item>april<tag>out.mon+="04";</tag></item> <item>may<tag>out.mon+="05";</tag></item> <item>june<tag>out.mon+="06";</tag></item> <item>july<tag>out.mon+="07";</tag></item> <item>august<tag>out.mon+="08";</tag></item> <item>september<tag>out.mon+="09";</tag></item> <item>october<tag>out.mon+="10";</tag></item> <item>november<tag>out.mon+="11";</tag></item> <item>december<tag>out.mon+="12";</tag></item> <item>jan<tag>out.mon+="01";</tag></item> <item>feb<tag>out.mon+="02";</tag></item> <item>aug<tag>out.mon+="08";</tag></item> <item>sept<tag>out.mon+="09";</tag></item> <item>oct<tag>out.mon+="10";</tag></item> <item>nov<tag>out.mon+="11";</tag></item> <item>dec<tag>out.mon+="12";</tag></item> </one-of> </rule> <rule id="digits"> <one-of> <item>zero<tag>out=0;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <one-of> <item>ten<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> </one-of> </rule> <rule id="thousands"> <item>two thousand</item> <item repeat="0-1">and</item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out = rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out = rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out = rules.above_twenty;</tag></item> </rule> <rule id="above_twenty"> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My last incorrect transaction date is july twenty three Output: 07/23 Scenario 2: Input: My last incorrect transaction date is july fifteen Output: 07/15 --> <rule id="main" scope="public"> <tag>out=""</tag> <item repeat="1-10"> <item><ruleref uri="#months"/><tag>out= rules.months.mon + "/";</tag></item> <one-of> <item><ruleref uri="#digits"/><tag>out+= rules.digits;</tag></item> <item><ruleref uri="#teens"/><tag>out+= rules.teens;</tag></item> <item><ruleref uri="#above_twenty"/><tag>out+= rules.above_twenty;</tag></item> </one-of> </item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My last incorrect transaction date is</item> <item repeat="0-1">It is</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="months"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.mon=""</tag> <one-of> <item>january<tag>out.mon+="01";</tag></item> <item>february<tag>out.mon+="02";</tag></item> <item>march<tag>out.mon+="03";</tag></item> <item>april<tag>out.mon+="04";</tag></item> <item>may<tag>out.mon+="05";</tag></item> <item>june<tag>out.mon+="06";</tag></item> <item>july<tag>out.mon+="07";</tag></item> <item>august<tag>out.mon+="08";</tag></item> <item>september<tag>out.mon+="09";</tag></item> <item>october<tag>out.mon+="10";</tag></item> <item>november<tag>out.mon+="11";</tag></item> <item>december<tag>out.mon+="12";</tag></item> <item>jan<tag>out.mon+="01";</tag></item> <item>feb<tag>out.mon+="02";</tag></item> <item>aug<tag>out.mon+="08";</tag></item> <item>sept<tag>out.mon+="09";</tag></item> <item>oct<tag>out.mon+="10";</tag></item> <item>nov<tag>out.mon+="11";</tag></item> <item>dec<tag>out.mon+="12";</tag></item> </one-of> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>0<tag>out=0;</tag></item> <item>1<tag>out=1;</tag></item> <item>2<tag>out=2;</tag></item> <item>3<tag>out=3;</tag></item> <item>4<tag>out=4;</tag></item> <item>5<tag>out=5;</tag></item> <item>6<tag>out=6;</tag></item> <item>7<tag>out=7;</tag></item> <item>8<tag>out=8;</tag></item> <item>9<tag>out=9;</tag></item> <item>first<tag>out=01;</tag></item> <item>second<tag>out=02;</tag></item> <item>third<tag>out=03;</tag></item> <item>fourth<tag>out=04;</tag></item> <item>fifth<tag>out=05;</tag></item> <item>sixth<tag>out=06;</tag></item> <item>seventh<tag>out=07;</tag></item> <item>eighth<tag>out=08;</tag></item> <item>ninth<tag>out=09;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>ten<tag>out=10;</tag></item> <item>tenth<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> <item>tenth<tag>out=10;</tag></item> <item>eleventh<tag>out=11;</tag></item> <item>twelveth<tag>out=12;</tag></item> <item>thirteenth<tag>out=13;</tag></item> <item>fourteenth<tag>out=14;</tag></item> <item>fifteenth<tag>out=15;</tag></item> <item>sixteenth<tag>out=16;</tag></item> <item>seventeenth<tag>out=17;</tag></item> <item>eighteenth<tag>out=18;</tag></item> <item>nineteenth<tag>out=19;</tag></item> </one-of> </rule> <rule id="above_twenty"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: I want to transfer twenty five Dollar Output: $25 Scenario 2: Input: transfer twenty five dollars Output: $25 --> <rule id="main" scope="public"> <tag>out="$"</tag> <one-of> <item><ruleref uri="#sub_hundred"/><tag>out += rules.sub_hundred.sh;</tag></item> <item><ruleref uri="#subThousands"/><tag>out += rules.subThousands;</tag></item> </one-of> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">I want to transfer</item> <item repeat="0-1">transfer</item> <item repeat="0-1">make a transfer for</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.num = 0;</tag> <one-of> <item>0<tag>out.num+=0;</tag></item> <item>1<tag>out.num+=1;</tag></item> <item>2<tag>out.num+=2;</tag></item> <item>3<tag>out.num+=3;</tag></item> <item>4<tag>out.num+=4;</tag></item> <item>5<tag>out.num+=5;</tag></item> <item>6<tag>out.num+=6;</tag></item> <item>7<tag>out.num+=7;</tag></item> <item>8<tag>out.num+=8;</tag></item> <item>9<tag>out.num+=9;</tag></item> <item>one<tag>out.num+=1;</tag></item> <item>two<tag>out.num+=2;</tag></item> <item>three<tag>out.num+=3;</tag></item> <item>four<tag>out.num+=4;</tag></item> <item>five<tag>out.num+=5;</tag></item> <item>six<tag>out.num+=6;</tag></item> <item>seven<tag>out.num+=7;</tag></item> <item>eight<tag>out.num+=8;</tag></item> <item>nine<tag>out.num+=9;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> <rule id="teens"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.teen = 0;</tag> <one-of> <item>ten<tag>out.teen+=10;</tag></item> <item>eleven<tag>out.teen+=11;</tag></item> <item>twelve<tag>out.teen+=12;</tag></item> <item>thirteen<tag>out.teen+=13;</tag></item> <item>fourteen<tag>out.teen+=14;</tag></item> <item>fifteen<tag>out.teen+=15;</tag></item> <item>sixteen<tag>out.teen+=16;</tag></item> <item>seventeen<tag>out.teen+=17;</tag></item> <item>eighteen<tag>out.teen+=18;</tag></item> <item>nineteen<tag>out.teen+=19;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> <rule id="above_twenty"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.tens = 0;</tag> <one-of> <item>twenty<tag>out.tens+=20;</tag></item> <item>thirty<tag>out.tens+=30;</tag></item> <item>forty<tag>out.tens+=40;</tag></item> <item>fifty<tag>out.tens+=50;</tag></item> <item>sixty<tag>out.tens+=60;</tag></item> <item>seventy<tag>out.tens+=70;</tag></item> <item>eighty<tag>out.tens+=80;</tag></item> <item>ninety<tag>out.tens+=90;</tag></item> <item>hundred<tag>out.tens+=100;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.tens += rules.digits.num;</tag></item> </rule> <rule id="currency"> <one-of> <item repeat="0-1">dollars</item> <item repeat="0-1">Dollars</item> <item repeat="0-1">dollar</item> <item repeat="0-1">Dollar</item> </one-of> </rule> <rule id="sub_hundred"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.sh = 0;</tag> <one-of> <item><ruleref uri="#teens"/><tag>out.sh += rules.teens.teen;</tag></item> <item> <ruleref uri="#above_twenty"/><tag>out.sh += rules.above_twenty.tens;</tag> </item> <item><ruleref uri="#digits"/><tag>out.sh += rules.digits.num;</tag></item> </one-of> </rule> <rule id="subThousands"> <ruleref uri="#sub_hundred"/><tag>out = (100 * rules.sub_hundred.sh);</tag> hundred <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty.tens;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens.teen;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits.num;</tag></item> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <rule id="main" scope="public"> <tag>out=""</tag> <ruleref uri="#digits"/><tag>out += rules.digits.numbers;</tag> </rule> <rule id="digits"> <tag>out.numbers=""</tag> <item repeat="1-12"> <one-of> <item>0<tag>out.numbers+=0;</tag></item> <item>1<tag>out.numbers+=1;</tag></item> <item>2<tag>out.numbers+=2;</tag></item> <item>3<tag>out.numbers+=3;</tag></item> <item>4<tag>out.numbers+=4;</tag></item> <item>5<tag>out.numbers+=5;</tag></item> <item>6<tag>out.numbers+=6;</tag></item> <item>7<tag>out.numbers+=7;</tag></item> <item>8<tag>out.numbers+=8;</tag></item> <item>9<tag>out.numbers+=9;</tag></item> <item>zero<tag>out.numbers+=0;</tag></item> <item>one<tag>out.numbers+=1;</tag></item> <item>two<tag>out.numbers+=2;</tag></item> <item>three<tag>out.numbers+=3;</tag></item> <item>four<tag>out.numbers+=4;</tag></item> <item>five<tag>out.numbers+=5;</tag></item> <item>six<tag>out.numbers+=6;</tag></item> <item>seven<tag>out.numbers+=7;</tag></item> <item>eight<tag>out.numbers+=8;</tag></item> <item>nine<tag>out.numbers+=9;</tag></item> <item>dash</item> </one-of> </item> </rule> </grammar>

Grammars for insurance (download)

The following grammars are supported for insurance domain: claim and policy numbers, driver's license and license plate numbers, expiration dates, start dates and renewal dates, claim and policy amounts.

<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="digits" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My claim number is One Five Four Two Output: 1542 Scenario 2: Input: Claim number One Five Four Four Output: 1544 --> <rule id="digits"> <tag>out=""</tag> <item><ruleref uri="#singleDigit"/><tag>out += rules.singleDigit.digit;</tag></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My claim number is</item> <item repeat="0-1">Claim number</item> <item repeat="0-1">This is for claim</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="singleDigit"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.digit=""</tag> <item repeat="1-10"> <one-of> <item>0<tag>out.digit+=0;</tag></item> <item>zero<tag>out.digit+=0;</tag></item> <item>1<tag>out.digit+=1;</tag></item> <item>one<tag>out.digit+=1;</tag></item> <item>2<tag>out.digit+=2;</tag></item> <item>two<tag>out.digit+=2;</tag></item> <item>3<tag>out.digit+=3;</tag></item> <item>three<tag>out.digit+=3;</tag></item> <item>4<tag>out.digit+=4;</tag></item> <item>four<tag>out.digit+=4;</tag></item> <item>5<tag>out.digit+=5;</tag></item> <item>five<tag>out.digit+=5;</tag></item> <item>6<tag>out.digit+=6;</tag></item> <item>six<tag>out.digit+=5;</tag></item> <item>7<tag>out.digit+=7;</tag></item> <item>seven<tag>out.digit+=7;</tag></item> <item>8<tag>out.digit+=8;</tag></item> <item>eight<tag>out.digit+=8;</tag></item> <item>9<tag>out.digit+=9;</tag></item> <item>nine<tag>out.digit+=9;</tag></item> </one-of> </item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My policy number is A B C 1 2 3 4 Output: ABC1234 Scenario 2: Input: This is the policy number 1 2 3 4 A B C Output: 1234ABC Scenario 3: Input: Hmm My policy number is 1 2 3 4 A B C 1 Output: 123ABC1 --> <rule id="main" scope="public"> <tag>out=""</tag> <item><ruleref uri="#alphanumeric"/><tag>out += rules.alphanumeric.alphanum;</tag></item> <item repeat="0-1"><ruleref uri="#alphabets"/><tag>out += rules.alphabets.letters;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits.numbers</tag></item> <item repeat="0-1"><ruleref uri="#thanks"/></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My policy number is</item> <item repeat="0-1">This is the policy number</item> <item repeat="0-1">Policy number</item> <item repeat="0-1">Yes, It is</item> <item repeat="0-1">Yes It is</item> <item repeat="0-1">Yes It's</item> <item repeat="0-1">My policy Id is</item> <item repeat="0-1">This is the policy Id</item> <item repeat="0-1">Policy Id</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="thanks"> <one-of> <item>Thanks</item> <item>I think</item> </one-of> </rule> <rule id="alphanumeric" scope="public"> <tag>out.alphanum=""</tag> <item><ruleref uri="#alphabets"/><tag>out.alphanum += rules.alphabets.letters;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.alphanum += rules.digits.numbers</tag></item> </rule> <rule id="alphabets"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.letters=""</tag> <tag>out.firstOccurence=""</tag> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.firstOccurence += rules.digits.numbers; out.letters += out.firstOccurence;</tag></item> <item repeat="1-"> <one-of> <item>A<tag>out.letters+='A';</tag></item> <item>B<tag>out.letters+='B';</tag></item> <item>C<tag>out.letters+='C';</tag></item> <item>D<tag>out.letters+='D';</tag></item> <item>E<tag>out.letters+='E';</tag></item> <item>F<tag>out.letters+='F';</tag></item> <item>G<tag>out.letters+='G';</tag></item> <item>H<tag>out.letters+='H';</tag></item> <item>I<tag>out.letters+='I';</tag></item> <item>J<tag>out.letters+='J';</tag></item> <item>K<tag>out.letters+='K';</tag></item> <item>L<tag>out.letters+='L';</tag></item> <item>M<tag>out.letters+='M';</tag></item> <item>N<tag>out.letters+='N';</tag></item> <item>O<tag>out.letters+='O';</tag></item> <item>P<tag>out.letters+='P';</tag></item> <item>Q<tag>out.letters+='Q';</tag></item> <item>R<tag>out.letters+='R';</tag></item> <item>S<tag>out.letters+='S';</tag></item> <item>T<tag>out.letters+='T';</tag></item> <item>U<tag>out.letters+='U';</tag></item> <item>V<tag>out.letters+='V';</tag></item> <item>W<tag>out.letters+='W';</tag></item> <item>X<tag>out.letters+='X';</tag></item> <item>Y<tag>out.letters+='Y';</tag></item> <item>Z<tag>out.letters+='Z';</tag></item> </one-of> </item> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.numbers=""</tag> <item repeat="1-10"> <one-of> <item>0<tag>out.numbers+=0;</tag></item> <item>1<tag>out.numbers+=1;</tag></item> <item>2<tag>out.numbers+=2;</tag></item> <item>3<tag>out.numbers+=3;</tag></item> <item>4<tag>out.numbers+=4;</tag></item> <item>5<tag>out.numbers+=5;</tag></item> <item>6<tag>out.numbers+=6;</tag></item> <item>7<tag>out.numbers+=7;</tag></item> <item>8<tag>out.numbers+=8;</tag></item> <item>9<tag>out.numbers+=9;</tag></item> </one-of> </item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="digits" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My drivers license number is One Five Four Two Output: 1542 Scenario 2: Input: driver license number One Five Four Four Output: 1544 --> <rule id="digits"> <tag>out=""</tag> <item><ruleref uri="#singleDigit"/><tag>out += rules.singleDigit.digit;</tag></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My drivers license number is</item> <item repeat="0-1">My drivers license id is</item> <item repeat="0-1">Driver license number</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="singleDigit"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.digit=""</tag> <item repeat="1-10"> <one-of> <item>0<tag>out.digit+=0;</tag></item> <item>zero<tag>out.digit+=0;</tag></item> <item>1<tag>out.digit+=1;</tag></item> <item>one<tag>out.digit+=1;</tag></item> <item>2<tag>out.digit+=2;</tag></item> <item>two<tag>out.digit+=2;</tag></item> <item>3<tag>out.digit+=3;</tag></item> <item>three<tag>out.digit+=3;</tag></item> <item>4<tag>out.digit+=4;</tag></item> <item>four<tag>out.digit+=4;</tag></item> <item>5<tag>out.digit+=5;</tag></item> <item>five<tag>out.digit+=5;</tag></item> <item>6<tag>out.digit+=6;</tag></item> <item>six<tag>out.digit+=5;</tag></item> <item>7<tag>out.digit+=7;</tag></item> <item>seven<tag>out.digit+=7;</tag></item> <item>8<tag>out.digit+=8;</tag></item> <item>eight<tag>out.digit+=8;</tag></item> <item>9<tag>out.digit+=9;</tag></item> <item>nine<tag>out.digit+=9;</tag></item> </one-of> </item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: my license plate is A B C D 1 2 Output: ABCD12 Scenario 2: Input: license plate number A B C 1 2 3 4 Output: ABC1234 Scenario 3: Input: my plates say A F G K 9 8 7 6 Thanks Output: AFGK9876 --> <rule id="main" scope="public"> <tag>out.licenseNum=""</tag> <item><ruleref uri="#alphabets"/><tag>out.licenseNum += rules.alphabets.letters;</tag></item> <item repeat="0-1"><ruleref uri="#thanks"/></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">my license plate is</item> <item repeat="0-1">license plate number</item> <item repeat="0-1">my plates say</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="thanks"> <one-of> <item>Thanks</item> <item>I think</item> </one-of> </rule> <rule id="alphabets"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.letters=""</tag> <tag>out.firstOccurence=""</tag> <item repeat="3-4"> <one-of> <item>A<tag>out.letters+='A';</tag></item> <item>B<tag>out.letters+='B';</tag></item> <item>C<tag>out.letters+='C';</tag></item> <item>D<tag>out.letters+='D';</tag></item> <item>E<tag>out.letters+='E';</tag></item> <item>F<tag>out.letters+='F';</tag></item> <item>G<tag>out.letters+='G';</tag></item> <item>H<tag>out.letters+='H';</tag></item> <item>I<tag>out.letters+='I';</tag></item> <item>J<tag>out.letters+='J';</tag></item> <item>K<tag>out.letters+='K';</tag></item> <item>L<tag>out.letters+='L';</tag></item> <item>M<tag>out.letters+='M';</tag></item> <item>N<tag>out.letters+='N';</tag></item> <item>O<tag>out.letters+='O';</tag></item> <item>P<tag>out.letters+='P';</tag></item> <item>Q<tag>out.letters+='Q';</tag></item> <item>R<tag>out.letters+='R';</tag></item> <item>S<tag>out.letters+='S';</tag></item> <item>T<tag>out.letters+='T';</tag></item> <item>U<tag>out.letters+='U';</tag></item> <item>V<tag>out.letters+='V';</tag></item> <item>W<tag>out.letters+='W';</tag></item> <item>X<tag>out.letters+='X';</tag></item> <item>Y<tag>out.letters+='Y';</tag></item> <item>Z<tag>out.letters+='Z';</tag></item> </one-of> </item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.firstOccurence += rules.digits.numbers; out.letters += out.firstOccurence;</tag></item> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.numbers=""</tag> <item repeat="2-4"> <one-of> <item>0<tag>out.numbers+=0;</tag></item> <item>1<tag>out.numbers+=1;</tag></item> <item>2<tag>out.numbers+=2;</tag></item> <item>3<tag>out.numbers+=3;</tag></item> <item>4<tag>out.numbers+=4;</tag></item> <item>5<tag>out.numbers+=5;</tag></item> <item>6<tag>out.numbers+=6;</tag></item> <item>7<tag>out.numbers+=7;</tag></item> <item>8<tag>out.numbers+=8;</tag></item> <item>9<tag>out.numbers+=9;</tag></item> </one-of> </item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="dateCardExpiration" mode="voice" tag-format="semantics/1.0"> <rule id="dateCardExpiration" scope="public"> <tag>out=""</tag> <item repeat="1"><ruleref uri="#months"/><tag>out = out + rules.months;</tag></item> <item repeat="1"><ruleref uri="#year"/><tag>out += " " + rules.year.yr;</tag></item> <item repeat="0-1"><ruleref uri="#thanks"/></item> </rule> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My card expiration date is july eleven Output: 07 2011 Scenario 2: Input: My card expiration date is may twenty six Output: 05 2026 --> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My card expiration date is </item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="thanks"> <one-of> <item>Thanks</item> <item>I think</item> </one-of> </rule> <rule id="months"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>january<tag>out="01";</tag></item> <item>february<tag>out="02";</tag></item> <item>march<tag>out="03";</tag></item> <item>april<tag>out="04";</tag></item> <item>may<tag>out="05";</tag></item> <item>june<tag>out="06";</tag></item> <item>july<tag>out="07";</tag></item> <item>august<tag>out="08";</tag></item> <item>september<tag>out="09";</tag></item> <item>october<tag>out="10";</tag></item> <item>november<tag>out="11";</tag></item> <item>december<tag>out="12";</tag></item> <item>jan<tag>out="01";</tag></item> <item>feb<tag>out="02";</tag></item> <item>aug<tag>out="08";</tag></item> <item>sept<tag>out="09";</tag></item> <item>oct<tag>out="10";</tag></item> <item>nov<tag>out="11";</tag></item> <item>dec<tag>out="12";</tag></item> <item>1<tag>out="01";</tag></item> <item>2<tag>out="02";</tag></item> <item>3<tag>out="03";</tag></item> <item>4<tag>out="04";</tag></item> <item>5<tag>out="05";</tag></item> <item>6<tag>out="06";</tag></item> <item>7<tag>out="07";</tag></item> <item>8<tag>out="08";</tag></item> <item>9<tag>out="09";</tag></item> <item>ten<tag>out="10";</tag></item> <item>eleven<tag>out="11";</tag></item> <item>twelve<tag>out="12";</tag></item> </one-of> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>0<tag>out=0;</tag></item> <item>1<tag>out=1;</tag></item> <item>2<tag>out=2;</tag></item> <item>3<tag>out=3;</tag></item> <item>4<tag>out=4;</tag></item> <item>5<tag>out=5;</tag></item> <item>6<tag>out=6;</tag></item> <item>7<tag>out=7;</tag></item> <item>8<tag>out=8;</tag></item> <item>9<tag>out=9;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="year"> <tag>out.yr="20"</tag> <one-of> <item><ruleref uri="#teens"/><tag>out.yr += rules.teens;</tag></item> <item><ruleref uri="#above_twenty"/><tag>out.yr += rules.above_twenty;</tag></item> </one-of> </rule> <rule id="teens"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>ten<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> <item>10<tag>out=10;</tag></item> <item>11<tag>out=11;</tag></item> <item>12<tag>out=12;</tag></item> <item>13<tag>out=13;</tag></item> <item>14<tag>out=14;</tag></item> <item>15<tag>out=15;</tag></item> <item>16<tag>out=16;</tag></item> <item>17<tag>out=17;</tag></item> <item>18<tag>out=18;</tag></item> <item>19<tag>out=19;</tag></item> </one-of> </rule> <rule id="above_twenty"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> <item>forty<tag>out=40;</tag></item> <item>fifty<tag>out=50;</tag></item> <item>sixty<tag>out=60;</tag></item> <item>seventy<tag>out=70;</tag></item> <item>eighty<tag>out=80;</tag></item> <item>ninety<tag>out=90;</tag></item> <item>20<tag>out=20;</tag></item> <item>30<tag>out=30;</tag></item> <item>40<tag>out=40;</tag></item> <item>50<tag>out=50;</tag></item> <item>60<tag>out=60;</tag></item> <item>70<tag>out=70;</tag></item> <item>80<tag>out=80;</tag></item> <item>90<tag>out=90;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My policy expired on July Five Two Thousand and Eleven Output: 07/5/11 Scenario 2: Input: My policy will expire on July Sixteen Two Thousand and Eleven Output: 07/16/11 Scenario 3: Input: My policy expired on July Thirty Two Thousand and Eleven Output: 07/30/11 --> <rule id="main" scope="public"> <tag>out=""</tag> <item> <item repeat="1"><ruleref uri="#months"/><tag>out = out + rules.months.mon + "/";</tag></item> <one-of> <item><ruleref uri="#digits"/><tag>out += rules.digits + "/";</tag></item> <item><ruleref uri="#teens"/><tag>out += rules.teens+ "/";</tag></item> <item><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty+ "/";</tag></item> </one-of> <one-of> <item><ruleref uri="#thousands"/><tag>out += rules.thousands;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty;</tag></item> </one-of> </item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My policy expired on</item> <item repeat="0-1">My policy will expire on</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="months"> <tag>out.mon=""</tag> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>january<tag>out.mon+="01";</tag></item> <item>february<tag>out.mon+="02";</tag></item> <item>march<tag>out.mon+="03";</tag></item> <item>april<tag>out.mon+="04";</tag></item> <item>may<tag>out.mon+="05";</tag></item> <item>june<tag>out.mon+="06";</tag></item> <item>july<tag>out.mon+="07";</tag></item> <item>august<tag>out.mon+="08";</tag></item> <item>september<tag>out.mon+="09";</tag></item> <item>october<tag>out.mon+="10";</tag></item> <item>november<tag>out.mon+="11";</tag></item> <item>december<tag>out.mon+="12";</tag></item> <item>jan<tag>out.mon+="01";</tag></item> <item>feb<tag>out.mon+="02";</tag></item> <item>aug<tag>out.mon+="08";</tag></item> <item>sept<tag>out.mon+="09";</tag></item> <item>oct<tag>out.mon+="10";</tag></item> <item>nov<tag>out.mon+="11";</tag></item> <item>dec<tag>out.mon+="12";</tag></item> </one-of> </rule> <rule id="digits"> <one-of> <item>zero<tag>out=0;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <one-of> <item>ten<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> </one-of> </rule> <rule id="thousands"> <item>two thousand</item> <item repeat="0-1">and</item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out = rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out = rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out = rules.above_twenty;</tag></item> </rule> <rule id="above_twenty"> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: I renewed my policy on July Two Thousand and Eleven Output: 07/11 Scenario 2: Input: My policy will renew on July Two Thousand and Eleven Output: 07/11 --> <rule id="main" scope="public"> <tag>out=""</tag> <item repeat="1-10"> <item repeat="1"><ruleref uri="#months"/><tag>out = out + rules.months.mon + "/";</tag></item> <one-of> <item><ruleref uri="#thousands"/><tag>out += rules.thousands;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty;</tag></item> </one-of> </item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My policy will renew on</item> <item repeat="0-1">My policy was renewed on</item> <item repeat="0-1">Renew policy on</item> <item repeat="0-1">I renewed my policy on</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="months"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.mon=""</tag> <one-of> <item>january<tag>out.mon+="01";</tag></item> <item>february<tag>out.mon+="02";</tag></item> <item>march<tag>out.mon+="03";</tag></item> <item>april<tag>out.mon+="04";</tag></item> <item>may<tag>out.mon+="05";</tag></item> <item>june<tag>out.mon+="06";</tag></item> <item>july<tag>out.mon+="07";</tag></item> <item>august<tag>out.mon+="08";</tag></item> <item>september<tag>out.mon+="09";</tag></item> <item>october<tag>out.mon+="10";</tag></item> <item>november<tag>out.mon+="11";</tag></item> <item>december<tag>out.mon+="12";</tag></item> <item>jan<tag>out.mon+="01";</tag></item> <item>feb<tag>out.mon+="02";</tag></item> <item>aug<tag>out.mon+="08";</tag></item> <item>sept<tag>out.mon+="09";</tag></item> <item>oct<tag>out.mon+="10";</tag></item> <item>nov<tag>out.mon+="11";</tag></item> <item>dec<tag>out.mon+="12";</tag></item> </one-of> </rule> <rule id="digits"> <one-of> <item>zero<tag>out=0;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <one-of> <item>ten<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> </one-of> </rule> <rule id="thousands"> <item>two thousand<!--<tag>out=2000;</tag>--></item> <item repeat="0-1">and</item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out = rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out = rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out = rules.above_twenty;</tag></item> </rule> <rule id="above_twenty"> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> <item>forty<tag>out=40;</tag></item> <item>fifty<tag>out=50;</tag></item> <item>sixty<tag>out=60;</tag></item> <item>seventy<tag>out=70;</tag></item> <item>eighty<tag>out=80;</tag></item> <item>ninety<tag>out=90;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: I bought my policy on july twenty three Output: 07/23 Scenario 2: Input: My policy started on july fifteen Output: 07/15 --> <rule id="main" scope="public"> <tag>out=""</tag> <item repeat="1-10"> <item><ruleref uri="#months"/><tag>out= rules.months.mon + "/";</tag></item> <one-of> <item><ruleref uri="#digits"/><tag>out+= rules.digits;</tag></item> <item><ruleref uri="#teens"/><tag>out+= rules.teens;</tag></item> <item><ruleref uri="#above_twenty"/><tag>out+= rules.above_twenty;</tag></item> </one-of> </item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">I bought my policy on</item> <item repeat="0-1">I bought policy on</item> <item repeat="0-1">My policy started on</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="months"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.mon=""</tag> <one-of> <item>january<tag>out.mon+="01";</tag></item> <item>february<tag>out.mon+="02";</tag></item> <item>march<tag>out.mon+="03";</tag></item> <item>april<tag>out.mon+="04";</tag></item> <item>may<tag>out.mon+="05";</tag></item> <item>june<tag>out.mon+="06";</tag></item> <item>july<tag>out.mon+="07";</tag></item> <item>august<tag>out.mon+="08";</tag></item> <item>september<tag>out.mon+="09";</tag></item> <item>october<tag>out.mon+="10";</tag></item> <item>november<tag>out.mon+="11";</tag></item> <item>december<tag>out.mon+="12";</tag></item> <item>jan<tag>out.mon+="01";</tag></item> <item>feb<tag>out.mon+="02";</tag></item> <item>aug<tag>out.mon+="08";</tag></item> <item>sept<tag>out.mon+="09";</tag></item> <item>oct<tag>out.mon+="10";</tag></item> <item>nov<tag>out.mon+="11";</tag></item> <item>dec<tag>out.mon+="12";</tag></item> </one-of> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>0<tag>out=0;</tag></item> <item>1<tag>out=1;</tag></item> <item>2<tag>out=2;</tag></item> <item>3<tag>out=3;</tag></item> <item>4<tag>out=4;</tag></item> <item>5<tag>out=5;</tag></item> <item>6<tag>out=6;</tag></item> <item>7<tag>out=7;</tag></item> <item>8<tag>out=8;</tag></item> <item>9<tag>out=9;</tag></item> <item>first<tag>out=01;</tag></item> <item>second<tag>out=02;</tag></item> <item>third<tag>out=03;</tag></item> <item>fourth<tag>out=04;</tag></item> <item>fifth<tag>out=05;</tag></item> <item>sixth<tag>out=06;</tag></item> <item>seventh<tag>out=07;</tag></item> <item>eighth<tag>out=08;</tag></item> <item>ninth<tag>out=09;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>ten<tag>out=10;</tag></item> <item>tenth<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> <item>tenth<tag>out=10;</tag></item> <item>eleventh<tag>out=11;</tag></item> <item>twelveth<tag>out=12;</tag></item> <item>thirteenth<tag>out=13;</tag></item> <item>fourteenth<tag>out=14;</tag></item> <item>fifteenth<tag>out=15;</tag></item> <item>sixteenth<tag>out=16;</tag></item> <item>seventeenth<tag>out=17;</tag></item> <item>eighteenth<tag>out=18;</tag></item> <item>nineteenth<tag>out=19;</tag></item> </one-of> </rule> <rule id="above_twenty"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: I want to make a claim of one hundre ten dollars Output: $110 Scenario 2: Input: Requesting claim of Two hundred dollars Output: $200 --> <rule id="main" scope="public"> <tag>out="$"</tag> <one-of> <item><ruleref uri="#sub_hundred"/><tag>out += rules.sub_hundred.sh;</tag></item> <item><ruleref uri="#subThousands"/><tag>out += rules.subThousands;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#thanks"/></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">I want to place a claim for</item> <item repeat="0-1">I want to make a claim of</item> <item repeat="0-1">I assess damage of</item> <item repeat="0-1">Requesting claim of</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="thanks"> <one-of> <item>Thanks</item> <item>I think</item> </one-of> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.num = 0;</tag> <one-of> <item>0<tag>out.num+=0;</tag></item> <item>1<tag>out.num+=1;</tag></item> <item>2<tag>out.num+=2;</tag></item> <item>3<tag>out.num+=3;</tag></item> <item>4<tag>out.num+=4;</tag></item> <item>5<tag>out.num+=5;</tag></item> <item>6<tag>out.num+=6;</tag></item> <item>7<tag>out.num+=7;</tag></item> <item>8<tag>out.num+=8;</tag></item> <item>9<tag>out.num+=9;</tag></item> <item>one<tag>out.num+=1;</tag></item> <item>two<tag>out.num+=2;</tag></item> <item>three<tag>out.num+=3;</tag></item> <item>four<tag>out.num+=4;</tag></item> <item>five<tag>out.num+=5;</tag></item> <item>six<tag>out.num+=6;</tag></item> <item>seven<tag>out.num+=7;</tag></item> <item>eight<tag>out.num+=8;</tag></item> <item>nine<tag>out.num+=9;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> <rule id="teens"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.teen = 0;</tag> <one-of> <item>ten<tag>out.teen+=10;</tag></item> <item>eleven<tag>out.teen+=11;</tag></item> <item>twelve<tag>out.teen+=12;</tag></item> <item>thirteen<tag>out.teen+=13;</tag></item> <item>fourteen<tag>out.teen+=14;</tag></item> <item>fifteen<tag>out.teen+=15;</tag></item> <item>sixteen<tag>out.teen+=16;</tag></item> <item>seventeen<tag>out.teen+=17;</tag></item> <item>eighteen<tag>out.teen+=18;</tag></item> <item>nineteen<tag>out.teen+=19;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> <rule id="above_twenty"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.tens = 0;</tag> <one-of> <item>twenty<tag>out.tens+=20;</tag></item> <item>thirty<tag>out.tens+=30;</tag></item> <item>forty<tag>out.tens+=40;</tag></item> <item>fifty<tag>out.tens+=50;</tag></item> <item>sixty<tag>out.tens+=60;</tag></item> <item>seventy<tag>out.tens+=70;</tag></item> <item>eighty<tag>out.tens+=80;</tag></item> <item>ninety<tag>out.tens+=90;</tag></item> <item>hundred<tag>out.tens+=100;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.tens += rules.digits.num;</tag></item> </rule> <rule id="currency"> <one-of> <item repeat="0-1">dollars</item> <item repeat="0-1">Dollars</item> <item repeat="0-1">dollar</item> <item repeat="0-1">Dollar</item> </one-of> </rule> <rule id="sub_hundred"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.sh = 0;</tag> <one-of> <item><ruleref uri="#teens"/><tag>out.sh += rules.teens.teen;</tag></item> <item> <ruleref uri="#above_twenty"/><tag>out.sh += rules.above_twenty.tens;</tag> </item> <item><ruleref uri="#digits"/><tag>out.sh += rules.digits.num;</tag></item> </one-of> </rule> <rule id="subThousands"> <ruleref uri="#sub_hundred"/><tag>out = (100 * rules.sub_hundred.sh);</tag> hundred <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty.tens;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens.teen;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits.num;</tag></item> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Premium amounts Scenario 1: Input: The premium for one hundre ten dollars Output: $110 Scenario 2: Input: RPremium amount of Two hundred dollars Output: $200 --> <rule id="main" scope="public"> <tag>out="$"</tag> <one-of> <item><ruleref uri="#sub_hundred"/><tag>out += rules.sub_hundred.sh;</tag></item> <item><ruleref uri="#subThousands"/><tag>out += rules.subThousands;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#thanks"/></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">A premium of</item> <item repeat="0-1">Premium amount of</item> <item repeat="0-1">The premium for</item> <item repeat="0-1">Insurance premium for</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="thanks"> <one-of> <item>Thanks</item> <item>I think</item> </one-of> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.num = 0;</tag> <one-of> <item>0<tag>out.num+=0;</tag></item> <item>1<tag>out.num+=1;</tag></item> <item>2<tag>out.num+=2;</tag></item> <item>3<tag>out.num+=3;</tag></item> <item>4<tag>out.num+=4;</tag></item> <item>5<tag>out.num+=5;</tag></item> <item>6<tag>out.num+=6;</tag></item> <item>7<tag>out.num+=7;</tag></item> <item>8<tag>out.num+=8;</tag></item> <item>9<tag>out.num+=9;</tag></item> <item>one<tag>out.num+=1;</tag></item> <item>two<tag>out.num+=2;</tag></item> <item>three<tag>out.num+=3;</tag></item> <item>four<tag>out.num+=4;</tag></item> <item>five<tag>out.num+=5;</tag></item> <item>six<tag>out.num+=6;</tag></item> <item>seven<tag>out.num+=7;</tag></item> <item>eight<tag>out.num+=8;</tag></item> <item>nine<tag>out.num+=9;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> <rule id="teens"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.teen = 0;</tag> <one-of> <item>ten<tag>out.teen+=10;</tag></item> <item>eleven<tag>out.teen+=11;</tag></item> <item>twelve<tag>out.teen+=12;</tag></item> <item>thirteen<tag>out.teen+=13;</tag></item> <item>fourteen<tag>out.teen+=14;</tag></item> <item>fifteen<tag>out.teen+=15;</tag></item> <item>sixteen<tag>out.teen+=16;</tag></item> <item>seventeen<tag>out.teen+=17;</tag></item> <item>eighteen<tag>out.teen+=18;</tag></item> <item>nineteen<tag>out.teen+=19;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> <rule id="above_twenty"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.tens = 0;</tag> <one-of> <item>twenty<tag>out.tens+=20;</tag></item> <item>thirty<tag>out.tens+=30;</tag></item> <item>forty<tag>out.tens+=40;</tag></item> <item>fifty<tag>out.tens+=50;</tag></item> <item>sixty<tag>out.tens+=60;</tag></item> <item>seventy<tag>out.tens+=70;</tag></item> <item>eighty<tag>out.tens+=80;</tag></item> <item>ninety<tag>out.tens+=90;</tag></item> <item>hundred<tag>out.tens+=100;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.tens += rules.digits.num;</tag></item> </rule> <rule id="currency"> <one-of> <item repeat="0-1">dollars</item> <item repeat="0-1">Dollars</item> <item repeat="0-1">dollar</item> <item repeat="0-1">Dollar</item> </one-of> </rule> <rule id="sub_hundred"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.sh = 0;</tag> <one-of> <item><ruleref uri="#teens"/><tag>out.sh += rules.teens.teen;</tag></item> <item> <ruleref uri="#above_twenty"/><tag>out.sh += rules.above_twenty.tens;</tag> </item> <item><ruleref uri="#digits"/><tag>out.sh += rules.digits.num;</tag></item> </one-of> </rule> <rule id="subThousands"> <ruleref uri="#sub_hundred"/><tag>out = (100 * rules.sub_hundred.sh);</tag> hundred <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty.tens;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens.teen;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits.num;</tag></item> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: The number is one Output: 1 Scenario 2: Input: I want policy for ten Output: 10 --> <rule id="main" scope="public"> <tag>out=""</tag> <one-of> <item repeat="1"><ruleref uri="#digits"/><tag>out+= rules.digits;</tag></item> <item repeat="1"><ruleref uri="#teens"/><tag>out+= rules.teens;</tag></item> <item repeat="1"><ruleref uri="#above_twenty"/><tag>out+= rules.above_twenty;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#thanks"/></item> </rule> <rule id="text"> <one-of> <item repeat="0-1">I want policy for</item> <item repeat="0-1">I want to order policy for</item> <item repeat="0-1">The number is</item> </one-of> </rule> <rule id="thanks"> <one-of> <item>Thanks</item> <item>I think</item> </one-of> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>0<tag>out=0;</tag></item> <item>1<tag>out=1;</tag></item> <item>2<tag>out=2;</tag></item> <item>3<tag>out=3;</tag></item> <item>4<tag>out=4;</tag></item> <item>5<tag>out=5;</tag></item> <item>6<tag>out=6;</tag></item> <item>7<tag>out=7;</tag></item> <item>8<tag>out=8;</tag></item> <item>9<tag>out=9;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>ten<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> <item>10<tag>out=10;</tag></item> <item>11<tag>out=11;</tag></item> <item>12<tag>out=12;</tag></item> <item>13<tag>out=13;</tag></item> <item>14<tag>out=14;</tag></item> <item>15<tag>out=15;</tag></item> <item>16<tag>out=16;</tag></item> <item>17<tag>out=17;</tag></item> <item>18<tag>out=18;</tag></item> <item>19<tag>out=19;</tag></item> </one-of> </rule> <rule id="above_twenty"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> <item>forty<tag>out=40;</tag></item> <item>fifty<tag>out=50;</tag></item> <item>sixty<tag>out=60;</tag></item> <item>seventy<tag>out=70;</tag></item> <item>eighty<tag>out=80;</tag></item> <item>ninety<tag>out=90;</tag></item> <item>20<tag>out=20;</tag></item> <item>30<tag>out=30;</tag></item> <item>40<tag>out=40;</tag></item> <item>50<tag>out=50;</tag></item> <item>60<tag>out=60;</tag></item> <item>70<tag>out=70;</tag></item> <item>80<tag>out=80;</tag></item> <item>90<tag>out=90;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>

Grammars for telecom (download)

The following grammars are supported for telecom: Phone number, serial number, SIM number, US Zip code, credit card expiration date, plan start, renewal and expiration dates, service start date, equipment quantity and bill amount.

<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="digits" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support 10-12 digits number and here are couple of examples of valid inputs: Scenario 1: Input: Mmm My phone number is two zero one two five two six seven eight five Output: 2012526785 Scenario 2: Input: My phone number is two zero one two five two six seven eight five Output: 2012526785 --> <rule id="digits"> <tag>out=""</tag> <item><ruleref uri="#singleDigit"/><tag>out += rules.singleDigit.digit;</tag></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My phone number is</item> <item repeat="0-1">Phone number is</item> <item repeat="0-1">It is</item> <item repeat="0-1">Yes, it's</item> <item repeat="0-1">Yes, it is</item> <item repeat="0-1">Yes it is</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="singleDigit"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.digit=""</tag> <item repeat="10-12"> <one-of> <item>0<tag>out.digit+=0;</tag></item> <item>zero<tag>out.digit+=0;</tag></item> <item>1<tag>out.digit+=1;</tag></item> <item>one<tag>out.digit+=1;</tag></item> <item>2<tag>out.digit+=2;</tag></item> <item>two<tag>out.digit+=2;</tag></item> <item>3<tag>out.digit+=3;</tag></item> <item>three<tag>out.digit+=3;</tag></item> <item>4<tag>out.digit+=4;</tag></item> <item>four<tag>out.digit+=4;</tag></item> <item>5<tag>out.digit+=5;</tag></item> <item>five<tag>out.digit+=5;</tag></item> <item>6<tag>out.digit+=6;</tag></item> <item>six<tag>out.digit+=5;</tag></item> <item>7<tag>out.digit+=7;</tag></item> <item>seven<tag>out.digit+=7;</tag></item> <item>8<tag>out.digit+=8;</tag></item> <item>eight<tag>out.digit+=8;</tag></item> <item>9<tag>out.digit+=9;</tag></item> <item>nine<tag>out.digit+=9;</tag></item> </one-of> </item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="digits" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My serial number is 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 Output: 123456789123456 Scenario 2: Input: Device Serial number 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 Output: 123456789123456 --> <rule id="digits"> <tag>out=""</tag> <item><ruleref uri="#singleDigit"/><tag>out += rules.singleDigit.digit;</tag></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My serial number is</item> <item repeat="0-1">Device Serial number</item> <item repeat="0-1">The number is</item> <item repeat="0-1">The IMEI number is</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="singleDigit"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.digit=""</tag> <item repeat="15"> <one-of> <item>0<tag>out.digit+=0;</tag></item> <item>zero<tag>out.digit+=0;</tag></item> <item>1<tag>out.digit+=1;</tag></item> <item>one<tag>out.digit+=1;</tag></item> <item>2<tag>out.digit+=2;</tag></item> <item>two<tag>out.digit+=2;</tag></item> <item>3<tag>out.digit+=3;</tag></item> <item>three<tag>out.digit+=3;</tag></item> <item>4<tag>out.digit+=4;</tag></item> <item>four<tag>out.digit+=4;</tag></item> <item>5<tag>out.digit+=5;</tag></item> <item>five<tag>out.digit+=5;</tag></item> <item>6<tag>out.digit+=6;</tag></item> <item>six<tag>out.digit+=5;</tag></item> <item>7<tag>out.digit+=7;</tag></item> <item>seven<tag>out.digit+=7;</tag></item> <item>8<tag>out.digit+=8;</tag></item> <item>eight<tag>out.digit+=8;</tag></item> <item>9<tag>out.digit+=9;</tag></item> <item>nine<tag>out.digit+=9;</tag></item> </one-of> </item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My SIM number is A B C 1 2 3 4 Output: ABC1234 Scenario 2: Input: My SIM number is 1 2 3 4 A B C Output: 1234ABC Scenario 3: Input: My SIM number is 1 2 3 4 A B C 1 Output: 123ABC1 --> <rule id="main" scope="public"> <tag>out=""</tag> <item><ruleref uri="#alphanumeric"/><tag>out += rules.alphanumeric.alphanum;</tag></item> <item repeat="0-1"><ruleref uri="#alphabets"/><tag>out += rules.alphabets.letters;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits.numbers</tag></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My SIM number is</item> <item repeat="0-1">SIM number is</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="alphanumeric" scope="public"> <tag>out.alphanum=""</tag> <item><ruleref uri="#alphabets"/><tag>out.alphanum += rules.alphabets.letters;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.alphanum += rules.digits.numbers</tag></item> </rule> <rule id="alphabets"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.letters=""</tag> <tag>out.firstOccurence=""</tag> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.firstOccurence += rules.digits.numbers; out.letters += out.firstOccurence;</tag></item> <item repeat="1-"> <one-of> <item>A<tag>out.letters+='A';</tag></item> <item>B<tag>out.letters+='B';</tag></item> <item>C<tag>out.letters+='C';</tag></item> <item>D<tag>out.letters+='D';</tag></item> <item>E<tag>out.letters+='E';</tag></item> <item>F<tag>out.letters+='F';</tag></item> <item>G<tag>out.letters+='G';</tag></item> <item>H<tag>out.letters+='H';</tag></item> <item>I<tag>out.letters+='I';</tag></item> <item>J<tag>out.letters+='J';</tag></item> <item>K<tag>out.letters+='K';</tag></item> <item>L<tag>out.letters+='L';</tag></item> <item>M<tag>out.letters+='M';</tag></item> <item>N<tag>out.letters+='N';</tag></item> <item>O<tag>out.letters+='O';</tag></item> <item>P<tag>out.letters+='P';</tag></item> <item>Q<tag>out.letters+='Q';</tag></item> <item>R<tag>out.letters+='R';</tag></item> <item>S<tag>out.letters+='S';</tag></item> <item>T<tag>out.letters+='T';</tag></item> <item>U<tag>out.letters+='U';</tag></item> <item>V<tag>out.letters+='V';</tag></item> <item>W<tag>out.letters+='W';</tag></item> <item>X<tag>out.letters+='X';</tag></item> <item>Y<tag>out.letters+='Y';</tag></item> <item>Z<tag>out.letters+='Z';</tag></item> </one-of> </item> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.numbers=""</tag> <item repeat="1-10"> <one-of> <item>0<tag>out.numbers+=0;</tag></item> <item>1<tag>out.numbers+=1;</tag></item> <item>2<tag>out.numbers+=2;</tag></item> <item>3<tag>out.numbers+=3;</tag></item> <item>4<tag>out.numbers+=4;</tag></item> <item>5<tag>out.numbers+=5;</tag></item> <item>6<tag>out.numbers+=6;</tag></item> <item>7<tag>out.numbers+=7;</tag></item> <item>8<tag>out.numbers+=8;</tag></item> <item>9<tag>out.numbers+=9;</tag></item> </one-of> </item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="digits" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support 5 digits code and here are couple of examples of valid inputs: Scenario 1: Input: Mmmm My zipcode is umm One Oh Nine Eight Seven Output: 10987 Scenario 2: Input: My zipcode is One Oh Nine Eight Seven Output: 10987 --> <rule id="digits"> <tag>out=""</tag> <item><ruleref uri="#singleDigit"/><tag>out += rules.singleDigit.digit;</tag></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My zipcode is</item> <item repeat="0-1">Zipcode is</item> <item repeat="0-1">It is</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="singleDigit"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.digit=""</tag> <item repeat="5"> <one-of> <item>0<tag>out.digit+=0;</tag></item> <item>zero<tag>out.digit+=0;</tag></item> <item>Oh<tag>out.digit+=0;</tag></item> <item>1<tag>out.digit+=1;</tag></item> <item>one<tag>out.digit+=1;</tag></item> <item>2<tag>out.digit+=2;</tag></item> <item>two<tag>out.digit+=2;</tag></item> <item>3<tag>out.digit+=3;</tag></item> <item>three<tag>out.digit+=3;</tag></item> <item>4<tag>out.digit+=4;</tag></item> <item>four<tag>out.digit+=4;</tag></item> <item>5<tag>out.digit+=5;</tag></item> <item>five<tag>out.digit+=5;</tag></item> <item>6<tag>out.digit+=6;</tag></item> <item>six<tag>out.digit+=5;</tag></item> <item>7<tag>out.digit+=7;</tag></item> <item>seven<tag>out.digit+=7;</tag></item> <item>8<tag>out.digit+=8;</tag></item> <item>eight<tag>out.digit+=8;</tag></item> <item>9<tag>out.digit+=9;</tag></item> <item>nine<tag>out.digit+=9;</tag></item> </one-of> </item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="dateCardExpiration" mode="voice" tag-format="semantics/1.0"> <rule id="dateCardExpiration" scope="public"> <tag>out=""</tag> <item repeat="1"><ruleref uri="#months"/><tag>out = out + rules.months;</tag></item> <item repeat="1"><ruleref uri="#year"/><tag>out += " " + rules.year.yr;</tag></item> </rule> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My card expiration date is july eleven Output: 07 2011 Scenario 2: Input: My card expiration date is may twenty six Output: 05 2026 --> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My card expiration date is </item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="months"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>january<tag>out="01";</tag></item> <item>february<tag>out="02";</tag></item> <item>march<tag>out="03";</tag></item> <item>april<tag>out="04";</tag></item> <item>may<tag>out="05";</tag></item> <item>june<tag>out="06";</tag></item> <item>july<tag>out="07";</tag></item> <item>august<tag>out="08";</tag></item> <item>september<tag>out="09";</tag></item> <item>october<tag>out="10";</tag></item> <item>november<tag>out="11";</tag></item> <item>december<tag>out="12";</tag></item> <item>jan<tag>out="01";</tag></item> <item>feb<tag>out="02";</tag></item> <item>aug<tag>out="08";</tag></item> <item>sept<tag>out="09";</tag></item> <item>oct<tag>out="10";</tag></item> <item>nov<tag>out="11";</tag></item> <item>dec<tag>out="12";</tag></item> <item>1<tag>out="01";</tag></item> <item>2<tag>out="02";</tag></item> <item>3<tag>out="03";</tag></item> <item>4<tag>out="04";</tag></item> <item>5<tag>out="05";</tag></item> <item>6<tag>out="06";</tag></item> <item>7<tag>out="07";</tag></item> <item>8<tag>out="08";</tag></item> <item>9<tag>out="09";</tag></item> <item>ten<tag>out="10";</tag></item> <item>eleven<tag>out="11";</tag></item> <item>twelve<tag>out="12";</tag></item> </one-of> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>0<tag>out=0;</tag></item> <item>1<tag>out=1;</tag></item> <item>2<tag>out=2;</tag></item> <item>3<tag>out=3;</tag></item> <item>4<tag>out=4;</tag></item> <item>5<tag>out=5;</tag></item> <item>6<tag>out=6;</tag></item> <item>7<tag>out=7;</tag></item> <item>8<tag>out=8;</tag></item> <item>9<tag>out=9;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="year"> <tag>out.yr="20"</tag> <one-of> <item><ruleref uri="#teens"/><tag>out.yr += rules.teens;</tag></item> <item><ruleref uri="#above_twenty"/><tag>out.yr += rules.above_twenty;</tag></item> </one-of> </rule> <rule id="teens"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>ten<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> <item>10<tag>out=10;</tag></item> <item>11<tag>out=11;</tag></item> <item>12<tag>out=12;</tag></item> <item>13<tag>out=13;</tag></item> <item>14<tag>out=14;</tag></item> <item>15<tag>out=15;</tag></item> <item>16<tag>out=16;</tag></item> <item>17<tag>out=17;</tag></item> <item>18<tag>out=18;</tag></item> <item>19<tag>out=19;</tag></item> </one-of> </rule> <rule id="above_twenty"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> <item>forty<tag>out=40;</tag></item> <item>fifty<tag>out=50;</tag></item> <item>sixty<tag>out=60;</tag></item> <item>seventy<tag>out=70;</tag></item> <item>eighty<tag>out=80;</tag></item> <item>ninety<tag>out=90;</tag></item> <item>20<tag>out=20;</tag></item> <item>30<tag>out=30;</tag></item> <item>40<tag>out=40;</tag></item> <item>50<tag>out=50;</tag></item> <item>60<tag>out=60;</tag></item> <item>70<tag>out=70;</tag></item> <item>80<tag>out=80;</tag></item> <item>90<tag>out=90;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My plan expires on July Five Two Thousand and Eleven Output: 07/5/11 Scenario 2: Input: My plan will expire on July Sixteen Two Thousand and Eleven Output: 07/16/11 Scenario 3: Input: My plan will expire on July Thirty Two Thousand and Eleven Output: 07/30/11 --> <rule id="main" scope="public"> <tag>out=""</tag> <item> <item repeat="1"><ruleref uri="#months"/><tag>out = out + rules.months.mon + "/";</tag></item> <one-of> <item><ruleref uri="#digits"/><tag>out += rules.digits + "/";</tag></item> <item><ruleref uri="#teens"/><tag>out += rules.teens+ "/";</tag></item> <item><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty+ "/";</tag></item> </one-of> <one-of> <item><ruleref uri="#thousands"/><tag>out += rules.thousands;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty;</tag></item> </one-of> </item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My plan expires on</item> <item repeat="0-1">My plan expired on</item> <item repeat="0-1">My plan will expire on</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="months"> <tag>out.mon=""</tag> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>january<tag>out.mon+="01";</tag></item> <item>february<tag>out.mon+="02";</tag></item> <item>march<tag>out.mon+="03";</tag></item> <item>april<tag>out.mon+="04";</tag></item> <item>may<tag>out.mon+="05";</tag></item> <item>june<tag>out.mon+="06";</tag></item> <item>july<tag>out.mon+="07";</tag></item> <item>august<tag>out.mon+="08";</tag></item> <item>september<tag>out.mon+="09";</tag></item> <item>october<tag>out.mon+="10";</tag></item> <item>november<tag>out.mon+="11";</tag></item> <item>december<tag>out.mon+="12";</tag></item> <item>jan<tag>out.mon+="01";</tag></item> <item>feb<tag>out.mon+="02";</tag></item> <item>aug<tag>out.mon+="08";</tag></item> <item>sept<tag>out.mon+="09";</tag></item> <item>oct<tag>out.mon+="10";</tag></item> <item>nov<tag>out.mon+="11";</tag></item> <item>dec<tag>out.mon+="12";</tag></item> </one-of> </rule> <rule id="digits"> <one-of> <item>zero<tag>out=0;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <one-of> <item>ten<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> </one-of> </rule> <rule id="thousands"> <item>two thousand</item> <item repeat="0-1">and</item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out = rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out = rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out = rules.above_twenty;</tag></item> </rule> <rule id="above_twenty"> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My plan will renew on July Two Thousand and Eleven Output: 07/11 Scenario 2: Input: Renew plan on July Two Thousand and Eleven Output: 07/11 --> <rule id="main" scope="public"> <tag>out=""</tag> <item repeat="1-10"> <item repeat="1"><ruleref uri="#months"/><tag>out = out + rules.months.mon + "/";</tag></item> <one-of> <item><ruleref uri="#thousands"/><tag>out += rules.thousands;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty;</tag></item> </one-of> </item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My plan will renew on</item> <item repeat="0-1">My plan was renewed on</item> <item repeat="0-1">Renew plan on</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="months"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.mon=""</tag> <one-of> <item>january<tag>out.mon+="01";</tag></item> <item>february<tag>out.mon+="02";</tag></item> <item>march<tag>out.mon+="03";</tag></item> <item>april<tag>out.mon+="04";</tag></item> <item>may<tag>out.mon+="05";</tag></item> <item>june<tag>out.mon+="06";</tag></item> <item>july<tag>out.mon+="07";</tag></item> <item>august<tag>out.mon+="08";</tag></item> <item>september<tag>out.mon+="09";</tag></item> <item>october<tag>out.mon+="10";</tag></item> <item>november<tag>out.mon+="11";</tag></item> <item>december<tag>out.mon+="12";</tag></item> <item>jan<tag>out.mon+="01";</tag></item> <item>feb<tag>out.mon+="02";</tag></item> <item>aug<tag>out.mon+="08";</tag></item> <item>sept<tag>out.mon+="09";</tag></item> <item>oct<tag>out.mon+="10";</tag></item> <item>nov<tag>out.mon+="11";</tag></item> <item>dec<tag>out.mon+="12";</tag></item> </one-of> </rule> <rule id="digits"> <one-of> <item>zero<tag>out=0;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <one-of> <item>ten<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> </one-of> </rule> <rule id="thousands"> <item>two thousand</item> <item repeat="0-1">and</item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out = rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out = rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out = rules.above_twenty;</tag></item> </rule> <rule id="above_twenty"> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> <item>forty<tag>out=40;</tag></item> <item>fifty<tag>out=50;</tag></item> <item>sixty<tag>out=60;</tag></item> <item>seventy<tag>out=70;</tag></item> <item>eighty<tag>out=80;</tag></item> <item>ninety<tag>out=90;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My plan will start on july twenty three Output: 07/23 Scenario 2: Input: My plan will start on july fifteen Output: 07/15 --> <rule id="main" scope="public"> <tag>out=""</tag> <item repeat="1-10"> <item><ruleref uri="#months"/><tag>out= rules.months.mon + "/";</tag></item> <one-of> <item><ruleref uri="#digits"/><tag>out+= rules.digits;</tag></item> <item><ruleref uri="#teens"/><tag>out+= rules.teens;</tag></item> <item><ruleref uri="#above_twenty"/><tag>out+= rules.above_twenty;</tag></item> </one-of> </item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My plan started on</item> <item repeat="0-1">My plan will start on</item> <item repeat="0-1">I paid it on</item> <item repeat="0-1">I paid bill for</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="months"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.mon=""</tag> <one-of> <item>january<tag>out.mon+="01";</tag></item> <item>february<tag>out.mon+="02";</tag></item> <item>march<tag>out.mon+="03";</tag></item> <item>april<tag>out.mon+="04";</tag></item> <item>may<tag>out.mon+="05";</tag></item> <item>june<tag>out.mon+="06";</tag></item> <item>july<tag>out.mon+="07";</tag></item> <item>august<tag>out.mon+="08";</tag></item> <item>september<tag>out.mon+="09";</tag></item> <item>october<tag>out.mon+="10";</tag></item> <item>november<tag>out.mon+="11";</tag></item> <item>december<tag>out.mon+="12";</tag></item> <item>jan<tag>out.mon+="01";</tag></item> <item>feb<tag>out.mon+="02";</tag></item> <item>aug<tag>out.mon+="08";</tag></item> <item>sept<tag>out.mon+="09";</tag></item> <item>oct<tag>out.mon+="10";</tag></item> <item>nov<tag>out.mon+="11";</tag></item> <item>dec<tag>out.mon+="12";</tag></item> </one-of> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>0<tag>out=0;</tag></item> <item>1<tag>out=1;</tag></item> <item>2<tag>out=2;</tag></item> <item>3<tag>out=3;</tag></item> <item>4<tag>out=4;</tag></item> <item>5<tag>out=5;</tag></item> <item>6<tag>out=6;</tag></item> <item>7<tag>out=7;</tag></item> <item>8<tag>out=8;</tag></item> <item>9<tag>out=9;</tag></item> <item>first<tag>out=01;</tag></item> <item>second<tag>out=02;</tag></item> <item>third<tag>out=03;</tag></item> <item>fourth<tag>out=04;</tag></item> <item>fifth<tag>out=05;</tag></item> <item>sixth<tag>out=06;</tag></item> <item>seventh<tag>out=07;</tag></item> <item>eighth<tag>out=08;</tag></item> <item>ninth<tag>out=09;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>ten<tag>out=10;</tag></item> <item>tenth<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> <item>tenth<tag>out=10;</tag></item> <item>eleventh<tag>out=11;</tag></item> <item>twelveth<tag>out=12;</tag></item> <item>thirteenth<tag>out=13;</tag></item> <item>fourteenth<tag>out=14;</tag></item> <item>fifteenth<tag>out=15;</tag></item> <item>sixteenth<tag>out=16;</tag></item> <item>seventeenth<tag>out=17;</tag></item> <item>eighteenth<tag>out=18;</tag></item> <item>nineteenth<tag>out=19;</tag></item> </one-of> </rule> <rule id="above_twenty"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: My plan starts on july twenty three Output: 07/23 Scenario 2: Input: I want to activate on july fifteen Output: 07/15 --> <rule id="main" scope="public"> <tag>out=""</tag> <item repeat="1-10"> <item><ruleref uri="#months"/><tag>out= rules.months.mon + "/";</tag></item> <one-of> <item><ruleref uri="#digits"/><tag>out+= rules.digits;</tag></item> <item><ruleref uri="#teens"/><tag>out+= rules.teens;</tag></item> <item><ruleref uri="#above_twenty"/><tag>out+= rules.above_twenty;</tag></item> </one-of> </item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">My plan starts on</item> <item repeat="0-1">I want to start my plan on</item> <item repeat="0-1">Activation date of</item> <item repeat="0-1">Start activation on</item> <item repeat="0-1">I want to activate on</item> <item repeat="0-1">Activate plan starting</item> <item repeat="0-1">Starting</item> <item repeat="0-1">Start on</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="months"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.mon=""</tag> <one-of> <item>january<tag>out.mon+="01";</tag></item> <item>february<tag>out.mon+="02";</tag></item> <item>march<tag>out.mon+="03";</tag></item> <item>april<tag>out.mon+="04";</tag></item> <item>may<tag>out.mon+="05";</tag></item> <item>june<tag>out.mon+="06";</tag></item> <item>july<tag>out.mon+="07";</tag></item> <item>august<tag>out.mon+="08";</tag></item> <item>september<tag>out.mon+="09";</tag></item> <item>october<tag>out.mon+="10";</tag></item> <item>november<tag>out.mon+="11";</tag></item> <item>december<tag>out.mon+="12";</tag></item> <item>jan<tag>out.mon+="01";</tag></item> <item>feb<tag>out.mon+="02";</tag></item> <item>aug<tag>out.mon+="08";</tag></item> <item>sept<tag>out.mon+="09";</tag></item> <item>oct<tag>out.mon+="10";</tag></item> <item>nov<tag>out.mon+="11";</tag></item> <item>dec<tag>out.mon+="12";</tag></item> </one-of> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>0<tag>out=0;</tag></item> <item>1<tag>out=1;</tag></item> <item>2<tag>out=2;</tag></item> <item>3<tag>out=3;</tag></item> <item>4<tag>out=4;</tag></item> <item>5<tag>out=5;</tag></item> <item>6<tag>out=6;</tag></item> <item>7<tag>out=7;</tag></item> <item>8<tag>out=8;</tag></item> <item>9<tag>out=9;</tag></item> <item>first<tag>out=01;</tag></item> <item>second<tag>out=02;</tag></item> <item>third<tag>out=03;</tag></item> <item>fourth<tag>out=04;</tag></item> <item>fifth<tag>out=05;</tag></item> <item>sixth<tag>out=06;</tag></item> <item>seventh<tag>out=07;</tag></item> <item>eighth<tag>out=08;</tag></item> <item>ninth<tag>out=09;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>ten<tag>out=10;</tag></item> <item>tenth<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> <item>tenth<tag>out=10;</tag></item> <item>eleventh<tag>out=11;</tag></item> <item>twelveth<tag>out=12;</tag></item> <item>thirteenth<tag>out=13;</tag></item> <item>fourteenth<tag>out=14;</tag></item> <item>fifteenth<tag>out=15;</tag></item> <item>sixteenth<tag>out=16;</tag></item> <item>seventeenth<tag>out=17;</tag></item> <item>eighteenth<tag>out=18;</tag></item> <item>nineteenth<tag>out=19;</tag></item> </one-of> </rule> <rule id="above_twenty"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Scenario 1: Input: The number is one Output: 1 Scenario 2: Input: It is ten Output: 10 --> <rule id="main" scope="public"> <tag>out=""</tag> <one-of> <item repeat="1"><ruleref uri="#digits"/><tag>out+= rules.digits;</tag></item> <item repeat="1"><ruleref uri="#teens"/><tag>out+= rules.teens;</tag></item> <item repeat="1"><ruleref uri="#above_twenty"/><tag>out+= rules.above_twenty;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#thanks"/></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">It is</item> <item repeat="0-1">The number is</item> <item repeat="0-1">Order</item> <item repeat="0-1">I want to order</item> <item repeat="0-1">Total equipment</item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="thanks"> <one-of> <item>Thanks</item> <item>I think</item> </one-of> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>0<tag>out=0;</tag></item> <item>1<tag>out=1;</tag></item> <item>2<tag>out=2;</tag></item> <item>3<tag>out=3;</tag></item> <item>4<tag>out=4;</tag></item> <item>5<tag>out=5;</tag></item> <item>6<tag>out=6;</tag></item> <item>7<tag>out=7;</tag></item> <item>8<tag>out=8;</tag></item> <item>9<tag>out=9;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>ten<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> <item>10<tag>out=10;</tag></item> <item>11<tag>out=11;</tag></item> <item>12<tag>out=12;</tag></item> <item>13<tag>out=13;</tag></item> <item>14<tag>out=14;</tag></item> <item>15<tag>out=15;</tag></item> <item>16<tag>out=16;</tag></item> <item>17<tag>out=17;</tag></item> <item>18<tag>out=18;</tag></item> <item>19<tag>out=19;</tag></item> </one-of> </rule> <rule id="above_twenty"> <item repeat="0-1"><ruleref uri="#text"/></item> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> <item>forty<tag>out=40;</tag></item> <item>fifty<tag>out=50;</tag></item> <item>sixty<tag>out=60;</tag></item> <item>seventy<tag>out=70;</tag></item> <item>eighty<tag>out=80;</tag></item> <item>ninety<tag>out=90;</tag></item> <item>20<tag>out=20;</tag></item> <item>30<tag>out=30;</tag></item> <item>40<tag>out=40;</tag></item> <item>50<tag>out=50;</tag></item> <item>60<tag>out=60;</tag></item> <item>70<tag>out=70;</tag></item> <item>80<tag>out=80;</tag></item> <item>90<tag>out=90;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Grammar will support the following inputs: Input: I want to make a payment of one hundred ten dollars Output: $110 --> <rule id="main" scope="public"> <tag>out="$"</tag> <one-of> <item><ruleref uri="#sub_hundred"/><tag>out += rules.sub_hundred.sh;</tag></item> <item><ruleref uri="#subThousands"/><tag>out += rules.subThousands;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#thanks"/></item> </rule> <rule id="text"> <item repeat="0-1"><ruleref uri="#hesitation"/></item> <one-of> <item repeat="0-1">I want to make a payment for</item> <item repeat="0-1">I want to make a payment of</item> <item repeat="0-1">Pay a total of</item> <item repeat="0-1">Paying</item> <item repeat="0-1">Pay bill for </item> </one-of> </rule> <rule id="hesitation"> <one-of> <item>Hmm</item> <item>Mmm</item> <item>My</item> </one-of> </rule> <rule id="thanks"> <one-of> <item>Thanks</item> <item>I think</item> </one-of> </rule> <rule id="digits"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.num = 0;</tag> <one-of> <item>0<tag>out.num+=0;</tag></item> <item>1<tag>out.num+=1;</tag></item> <item>2<tag>out.num+=2;</tag></item> <item>3<tag>out.num+=3;</tag></item> <item>4<tag>out.num+=4;</tag></item> <item>5<tag>out.num+=5;</tag></item> <item>6<tag>out.num+=6;</tag></item> <item>7<tag>out.num+=7;</tag></item> <item>8<tag>out.num+=8;</tag></item> <item>9<tag>out.num+=9;</tag></item> <item>one<tag>out.num+=1;</tag></item> <item>two<tag>out.num+=2;</tag></item> <item>three<tag>out.num+=3;</tag></item> <item>four<tag>out.num+=4;</tag></item> <item>five<tag>out.num+=5;</tag></item> <item>six<tag>out.num+=6;</tag></item> <item>seven<tag>out.num+=7;</tag></item> <item>eight<tag>out.num+=8;</tag></item> <item>nine<tag>out.num+=9;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> <rule id="teens"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.teen = 0;</tag> <one-of> <item>ten<tag>out.teen+=10;</tag></item> <item>eleven<tag>out.teen+=11;</tag></item> <item>twelve<tag>out.teen+=12;</tag></item> <item>thirteen<tag>out.teen+=13;</tag></item> <item>fourteen<tag>out.teen+=14;</tag></item> <item>fifteen<tag>out.teen+=15;</tag></item> <item>sixteen<tag>out.teen+=16;</tag></item> <item>seventeen<tag>out.teen+=17;</tag></item> <item>eighteen<tag>out.teen+=18;</tag></item> <item>nineteen<tag>out.teen+=19;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> <rule id="above_twenty"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.tens = 0;</tag> <one-of> <item>twenty<tag>out.tens+=20;</tag></item> <item>thirty<tag>out.tens+=30;</tag></item> <item>forty<tag>out.tens+=40;</tag></item> <item>fifty<tag>out.tens+=50;</tag></item> <item>sixty<tag>out.tens+=60;</tag></item> <item>seventy<tag>out.tens+=70;</tag></item> <item>eighty<tag>out.tens+=80;</tag></item> <item>ninety<tag>out.tens+=90;</tag></item> <item>hundred<tag>out.tens+=100;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.tens += rules.digits.num;</tag></item> </rule> <rule id="currency"> <one-of> <item repeat="0-1">dollars</item> <item repeat="0-1">Dollars</item> <item repeat="0-1">dollar</item> <item repeat="0-1">Dollar</item> </one-of> </rule> <rule id="sub_hundred"> <item repeat="0-1"><ruleref uri="#text"/></item> <tag>out.sh = 0;</tag> <one-of> <item><ruleref uri="#teens"/><tag>out.sh += rules.teens.teen;</tag></item> <item> <ruleref uri="#above_twenty"/><tag>out.sh += rules.above_twenty.tens;</tag> </item> <item><ruleref uri="#digits"/><tag>out.sh += rules.digits.num;</tag></item> </one-of> </rule> <rule id="subThousands"> <ruleref uri="#sub_hundred"/><tag>out = (100 * rules.sub_hundred.sh);</tag> hundred <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty.tens;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens.teen;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits.num;</tag></item> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> </grammar>

Generic grammars (download)

We provide the following generic grammars: alphanumeric, currency, date (mm/dd/yy), numbers, greeting, hesitation, and agent.

<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <!-- Test Cases Scenario 1: Input: A B C 1 2 3 4 Output: ABC1234 Scenario 2: Input: 1 2 3 4 A B C Output: 1234ABC Scenario 3: Input: 1 2 3 4 A B C 1 Output: 123ABC1 --> <rule id="main" scope="public"> <tag>out=""</tag> <item><ruleref uri="#alphanumeric"/><tag>out += rules.alphanumeric.alphanum;</tag></item> <item repeat="0-1"><ruleref uri="#alphabets"/><tag>out += rules.alphabets.letters;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits.numbers</tag></item> </rule> <rule id="alphanumeric" scope="public"> <tag>out.alphanum=""</tag> <item><ruleref uri="#alphabets"/><tag>out.alphanum += rules.alphabets.letters;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.alphanum += rules.digits.numbers</tag></item> </rule> <rule id="alphabets"> <tag>out.letters=""</tag> <tag>out.firstOccurence=""</tag> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.firstOccurence += rules.digits.numbers; out.letters += out.firstOccurence;</tag></item> <item repeat="1-"> <one-of> <item>A<tag>out.letters+='A';</tag></item> <item>B<tag>out.letters+='B';</tag></item> <item>C<tag>out.letters+='C';</tag></item> <item>D<tag>out.letters+='D';</tag></item> <item>E<tag>out.letters+='E';</tag></item> <item>F<tag>out.letters+='F';</tag></item> <item>G<tag>out.letters+='G';</tag></item> <item>H<tag>out.letters+='H';</tag></item> <item>I<tag>out.letters+='I';</tag></item> <item>J<tag>out.letters+='J';</tag></item> <item>K<tag>out.letters+='K';</tag></item> <item>L<tag>out.letters+='L';</tag></item> <item>M<tag>out.letters+='M';</tag></item> <item>N<tag>out.letters+='N';</tag></item> <item>O<tag>out.letters+='O';</tag></item> <item>P<tag>out.letters+='P';</tag></item> <item>Q<tag>out.letters+='Q';</tag></item> <item>R<tag>out.letters+='R';</tag></item> <item>S<tag>out.letters+='S';</tag></item> <item>T<tag>out.letters+='T';</tag></item> <item>U<tag>out.letters+='U';</tag></item> <item>V<tag>out.letters+='V';</tag></item> <item>W<tag>out.letters+='W';</tag></item> <item>X<tag>out.letters+='X';</tag></item> <item>Y<tag>out.letters+='Y';</tag></item> <item>Z<tag>out.letters+='Z';</tag></item> </one-of> </item> </rule> <rule id="digits"> <tag>out.numbers=""</tag> <item repeat="1-10"> <one-of> <item>0<tag>out.numbers+=0;</tag></item> <item>1<tag>out.numbers+=1;</tag></item> <item>2<tag>out.numbers+=2;</tag></item> <item>3<tag>out.numbers+=3;</tag></item> <item>4<tag>out.numbers+=4;</tag></item> <item>5<tag>out.numbers+=5;</tag></item> <item>6<tag>out.numbers+=6;</tag></item> <item>7<tag>out.numbers+=7;</tag></item> <item>8<tag>out.numbers+=8;</tag></item> <item>9<tag>out.numbers+=9;</tag></item> </one-of> </item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <rule id="main" scope="public"> <tag>out="$"</tag> <one-of> <item><ruleref uri="#sub_hundred"/><tag>out += rules.sub_hundred.sh;</tag></item> <item><ruleref uri="#subThousands"/><tag>out += rules.subThousands;</tag></item> </one-of> </rule> <rule id="digits"> <tag>out.num = 0;</tag> <one-of> <item>0<tag>out.num+=0;</tag></item> <item>1<tag>out.num+=1;</tag></item> <item>2<tag>out.num+=2;</tag></item> <item>3<tag>out.num+=3;</tag></item> <item>4<tag>out.num+=4;</tag></item> <item>5<tag>out.num+=5;</tag></item> <item>6<tag>out.num+=6;</tag></item> <item>7<tag>out.num+=7;</tag></item> <item>8<tag>out.num+=8;</tag></item> <item>9<tag>out.num+=9;</tag></item> <item>one<tag>out.num+=1;</tag></item> <item>two<tag>out.num+=2;</tag></item> <item>three<tag>out.num+=3;</tag></item> <item>four<tag>out.num+=4;</tag></item> <item>five<tag>out.num+=5;</tag></item> <item>six<tag>out.num+=6;</tag></item> <item>seven<tag>out.num+=7;</tag></item> <item>eight<tag>out.num+=8;</tag></item> <item>nine<tag>out.num+=9;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> <rule id="teens"> <tag>out.teen = 0;</tag> <one-of> <item>ten<tag>out.teen+=10;</tag></item> <item>eleven<tag>out.teen+=11;</tag></item> <item>twelve<tag>out.teen+=12;</tag></item> <item>thirteen<tag>out.teen+=13;</tag></item> <item>fourteen<tag>out.teen+=14;</tag></item> <item>fifteen<tag>out.teen+=15;</tag></item> <item>sixteen<tag>out.teen+=16;</tag></item> <item>seventeen<tag>out.teen+=17;</tag></item> <item>eighteen<tag>out.teen+=18;</tag></item> <item>nineteen<tag>out.teen+=19;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> </rule> <rule id="above_twenty"> <tag>out.tens = 0;</tag> <one-of> <item>twenty<tag>out.tens+=20;</tag></item> <item>thirty<tag>out.tens+=30;</tag></item> <item>forty<tag>out.tens+=40;</tag></item> <item>fifty<tag>out.tens+=50;</tag></item> <item>sixty<tag>out.tens+=60;</tag></item> <item>seventy<tag>out.tens+=70;</tag></item> <item>eighty<tag>out.tens+=80;</tag></item> <item>ninety<tag>out.tens+=90;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#currency"/></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out.tens += rules.digits.num;</tag></item> </rule> <rule id="currency"> <one-of> <item repeat="0-1">dollars</item> <item repeat="0-1">Dollars</item> <item repeat="0-1">dollar</item> <item repeat="0-1">Dollar</item> </one-of> </rule> <rule id="sub_hundred"> <tag>out.sh = 0;</tag> <one-of> <item><ruleref uri="#teens"/><tag>out.sh += rules.teens.teen;</tag></item> <item> <ruleref uri="#above_twenty"/><tag>out.sh += rules.above_twenty.tens;</tag> </item> <item><ruleref uri="#digits"/><tag>out.sh += rules.digits.num;</tag></item> </one-of> </rule> <rule id="subThousands"> <ruleref uri="#sub_hundred"/><tag>out = (100 * rules.sub_hundred.sh);</tag> hundred <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty.tens;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens.teen;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits.num;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <rule id="main" scope="public"> <tag>out=""</tag> <item repeat="1-10"> <one-of> <item><ruleref uri="#digits"/><tag>out += rules.digits + " ";</tag></item> <item><ruleref uri="#teens"/><tag>out += rules.teens+ " ";</tag></item> <item><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty+ " ";</tag></item> </one-of> <item><ruleref uri="#months"/><tag>out = out + rules.months;</tag></item> </item> </rule> <rule id="months"> <one-of> <item>january<tag>out="january";</tag></item> <item>february<tag>out="february";</tag></item> <item>march<tag>out="march";</tag></item> <item>april<tag>out="april";</tag></item> <item>may<tag>out="may";</tag></item> <item>june<tag>out="june";</tag></item> <item>july<tag>out="july";</tag></item> <item>august<tag>out="august";</tag></item> <item>september<tag>out="september";</tag></item> <item>october<tag>out="october";</tag></item> <item>november<tag>out="november";</tag></item> <item>december<tag>out="december";</tag></item> <item>jan<tag>out="january";</tag></item> <item>feb<tag>out="february";</tag></item> <item>aug<tag>out="august";</tag></item> <item>sept<tag>out="september";</tag></item> <item>oct<tag>out="october";</tag></item> <item>nov<tag>out="november";</tag></item> <item>dec<tag>out="december";</tag></item> </one-of> </rule> <rule id="digits"> <one-of> <item>0<tag>out=0;</tag></item> <item>1<tag>out=1;</tag></item> <item>2<tag>out=2;</tag></item> <item>3<tag>out=3;</tag></item> <item>4<tag>out=4;</tag></item> <item>5<tag>out=5;</tag></item> <item>6<tag>out=6;</tag></item> <item>7<tag>out=7;</tag></item> <item>8<tag>out=8;</tag></item> <item>9<tag>out=9;</tag></item> <item>first<tag>out=1;</tag></item> <item>second<tag>out=2;</tag></item> <item>third<tag>out=3;</tag></item> <item>fourth<tag>out=4;</tag></item> <item>fifth<tag>out=5;</tag></item> <item>sixth<tag>out=6;</tag></item> <item>seventh<tag>out=7;</tag></item> <item>eighth<tag>out=8;</tag></item> <item>ninth<tag>out=9;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <one-of> <item>ten<tag>out=10;</tag></item> <item>tenth<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> <item>tenth<tag>out=10;</tag></item> <item>eleventh<tag>out=11;</tag></item> <item>twelveth<tag>out=12;</tag></item> <item>thirteenth<tag>out=13;</tag></item> <item>fourteenth<tag>out=14;</tag></item> <item>fifteenth<tag>out=15;</tag></item> <item>sixteenth<tag>out=16;</tag></item> <item>seventeenth<tag>out=17;</tag></item> <item>eighteenth<tag>out=18;</tag></item> <item>nineteenth<tag>out=19;</tag></item> </one-of> </rule> <rule id="above_twenty"> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <rule id="main" scope="public"> <tag>out=""</tag> <item repeat="1-10"> <item repeat="1"><ruleref uri="#months"/><tag>out = out + rules.months.mon + " ";</tag></item> <one-of> <item><ruleref uri="#thousands"/><tag>out += rules.thousands;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty;</tag></item> </one-of> </item> </rule> <rule id="months"> <tag>out.mon=""</tag> <one-of> <item>january<tag>out.mon+="january";</tag></item> <item>february<tag>out.mon+="february";</tag></item> <item>march<tag>out.mon+="march";</tag></item> <item>april<tag>out.mon+="april";</tag></item> <item>may<tag>out.mon+="may";</tag></item> <item>june<tag>out.mon+="june";</tag></item> <item>july<tag>out.mon+="july";</tag></item> <item>august<tag>out.mon+="august";</tag></item> <item>september<tag>out.mon+="september";</tag></item> <item>october<tag>out.mon+="october";</tag></item> <item>november<tag>out.mon+="november";</tag></item> <item>december<tag>out.mon+="december";</tag></item> <item>jan<tag>out.mon+="january";</tag></item> <item>feb<tag>out.mon+="february";</tag></item> <item>aug<tag>out.mon+="august";</tag></item> <item>sept<tag>out.mon+="september";</tag></item> <item>oct<tag>out.mon+="october";</tag></item> <item>nov<tag>out.mon+="november";</tag></item> <item>dec<tag>out.mon+="december";</tag></item> </one-of> </rule> <rule id="digits"> <one-of> <item>zero<tag>out=0;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <one-of> <item>ten<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> </one-of> </rule> <!-- <rule id="singleDigit"> <item><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> --> <rule id="thousands"> <!-- <item> <ruleref uri="#digits"/> <tag>out = (1000 * rules.digits);</tag> thousand </item> --> <item>two thousand<tag>out=2000;</tag></item> <item repeat="0-1">and</item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty;</tag></item> </rule> <rule id="above_twenty"> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> <item>forty<tag>out=40;</tag></item> <item>fifty<tag>out=50;</tag></item> <item>sixty<tag>out=60;</tag></item> <item>seventy<tag>out=70;</tag></item> <item>eighty<tag>out=80;</tag></item> <item>ninety<tag>out=90;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <rule id="main" scope="public"> <tag>out=""</tag> <item repeat="1-10"> <one-of> <item><ruleref uri="#digits"/><tag>out += rules.digits + " ";</tag></item> <item><ruleref uri="#teens"/><tag>out += rules.teens+ " ";</tag></item> <item><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty+ " ";</tag></item> </one-of> <item repeat="1"><ruleref uri="#months"/><tag>out = out + rules.months.mon + " ";</tag></item> <one-of> <item><ruleref uri="#thousands"/><tag>out += rules.thousands;</tag></item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty;</tag></item> </one-of> </item> </rule> <rule id="months"> <tag>out.mon=""</tag> <one-of> <item>january<tag>out.mon+="january";</tag></item> <item>february<tag>out.mon+="february";</tag></item> <item>march<tag>out.mon+="march";</tag></item> <item>april<tag>out.mon+="april";</tag></item> <item>may<tag>out.mon+="may";</tag></item> <item>june<tag>out.mon+="june";</tag></item> <item>july<tag>out.mon+="july";</tag></item> <item>august<tag>out.mon+="august";</tag></item> <item>september<tag>out.mon+="september";</tag></item> <item>october<tag>out.mon+="october";</tag></item> <item>november<tag>out.mon+="november";</tag></item> <item>december<tag>out.mon+="december";</tag></item> <item>jan<tag>out.mon+="january";</tag></item> <item>feb<tag>out.mon+="february";</tag></item> <item>aug<tag>out.mon+="august";</tag></item> <item>sept<tag>out.mon+="september";</tag></item> <item>oct<tag>out.mon+="october";</tag></item> <item>nov<tag>out.mon+="november";</tag></item> <item>dec<tag>out.mon+="december";</tag></item> </one-of> </rule> <rule id="digits"> <one-of> <item>zero<tag>out=0;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <one-of> <item>ten<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> </one-of> </rule> <rule id="thousands"> <item>two thousand<tag>out=2000;</tag></item> <item repeat="0-1">and</item> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> <item repeat="0-1"><ruleref uri="#teens"/><tag>out += rules.teens;</tag></item> <item repeat="0-1"><ruleref uri="#above_twenty"/><tag>out += rules.above_twenty;</tag></item> </rule> <rule id="above_twenty"> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> <item>forty<tag>out=40;</tag></item> <item>fifty<tag>out=50;</tag></item> <item>sixty<tag>out=60;</tag></item> <item>seventy<tag>out=70;</tag></item> <item>eighty<tag>out=80;</tag></item> <item>ninety<tag>out=90;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="digits" mode="voice" tag-format="semantics/1.0"> <rule id="digits"> <tag>out=""</tag> <item><ruleref uri="#singleDigit"/><tag>out += rules.singleDigit.digit;</tag></item> </rule> <rule id="singleDigit"> <tag>out.digit=""</tag> <item repeat="1-10"> <one-of> <item>0<tag>out.digit+=0;</tag></item> <item>zero<tag>out.digit+=0;</tag></item> <item>1<tag>out.digit+=1;</tag></item> <item>one<tag>out.digit+=1;</tag></item> <item>2<tag>out.digit+=2;</tag></item> <item>two<tag>out.digit+=2;</tag></item> <item>3<tag>out.digit+=3;</tag></item> <item>three<tag>out.digit+=3;</tag></item> <item>4<tag>out.digit+=4;</tag></item> <item>four<tag>out.digit+=4;</tag></item> <item>5<tag>out.digit+=5;</tag></item> <item>five<tag>out.digit+=5;</tag></item> <item>6<tag>out.digit+=6;</tag></item> <item>six<tag>out.digit+=5;</tag></item> <item>7<tag>out.digit+=7;</tag></item> <item>seven<tag>out.digit+=7;</tag></item> <item>8<tag>out.digit+=8;</tag></item> <item>eight<tag>out.digit+=8;</tag></item> <item>9<tag>out.digit+=9;</tag></item> <item>nine<tag>out.digit+=9;</tag></item> </one-of> </item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <rule id="main" scope="public"> <tag>out=""</tag> <one-of> <item repeat="1"><ruleref uri="#digits"/><tag>out+= rules.digits;</tag></item> <item repeat="1"><ruleref uri="#teens"/><tag>out+= rules.teens;</tag></item> <item repeat="1"><ruleref uri="#above_twenty"/><tag>out+= rules.above_twenty;</tag></item> </one-of> </rule> <rule id="digits"> <one-of> <item>0<tag>out=0;</tag></item> <item>1<tag>out=1;</tag></item> <item>2<tag>out=2;</tag></item> <item>3<tag>out=3;</tag></item> <item>4<tag>out=4;</tag></item> <item>5<tag>out=5;</tag></item> <item>6<tag>out=6;</tag></item> <item>7<tag>out=7;</tag></item> <item>8<tag>out=8;</tag></item> <item>9<tag>out=9;</tag></item> <item>one<tag>out=1;</tag></item> <item>two<tag>out=2;</tag></item> <item>three<tag>out=3;</tag></item> <item>four<tag>out=4;</tag></item> <item>five<tag>out=5;</tag></item> <item>six<tag>out=6;</tag></item> <item>seven<tag>out=7;</tag></item> <item>eight<tag>out=8;</tag></item> <item>nine<tag>out=9;</tag></item> </one-of> </rule> <rule id="teens"> <one-of> <item>ten<tag>out=10;</tag></item> <item>eleven<tag>out=11;</tag></item> <item>twelve<tag>out=12;</tag></item> <item>thirteen<tag>out=13;</tag></item> <item>fourteen<tag>out=14;</tag></item> <item>fifteen<tag>out=15;</tag></item> <item>sixteen<tag>out=16;</tag></item> <item>seventeen<tag>out=17;</tag></item> <item>eighteen<tag>out=18;</tag></item> <item>nineteen<tag>out=19;</tag></item> <item>10<tag>out=10;</tag></item> <item>11<tag>out=11;</tag></item> <item>12<tag>out=12;</tag></item> <item>13<tag>out=13;</tag></item> <item>14<tag>out=14;</tag></item> <item>15<tag>out=15;</tag></item> <item>16<tag>out=16;</tag></item> <item>17<tag>out=17;</tag></item> <item>18<tag>out=18;</tag></item> <item>19<tag>out=19;</tag></item> </one-of> </rule> <rule id="above_twenty"> <one-of> <item>twenty<tag>out=20;</tag></item> <item>thirty<tag>out=30;</tag></item> <item>forty<tag>out=40;</tag></item> <item>fifty<tag>out=50;</tag></item> <item>sixty<tag>out=60;</tag></item> <item>seventy<tag>out=70;</tag></item> <item>eighty<tag>out=80;</tag></item> <item>ninety<tag>out=90;</tag></item> <item>20<tag>out=20;</tag></item> <item>30<tag>out=30;</tag></item> <item>40<tag>out=40;</tag></item> <item>50<tag>out=50;</tag></item> <item>60<tag>out=60;</tag></item> <item>70<tag>out=70;</tag></item> <item>80<tag>out=80;</tag></item> <item>90<tag>out=90;</tag></item> </one-of> <item repeat="0-1"><ruleref uri="#digits"/><tag>out += rules.digits;</tag></item> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <rule id="main" scope="public"> <tag>out=""</tag> <ruleref uri="#text"/><tag>out = rules.text</tag> </rule> <rule id="text"> <one-of> <item>Can I talk to the agent<tag>out="You will be trasnfered to the agent in a while"</tag></item> <item>talk to an agent<tag>out="You will be trasnfered to the agent in a while"</tag></item> </one-of> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <rule id="main" scope="public"> <tag>out=""</tag> <ruleref uri="#text"/><tag>out = rules.text</tag> </rule> <rule id="text"> <one-of> <item>hey<tag>out="Greeting"</tag></item> <item>hi<tag>out="Greeting"</tag></item> <item>Hi<tag>out="Greeting"</tag></item> <item>Hey<tag>out="Greeting"</tag></item> <item>Hello<tag>out="Greeting"</tag></item> <item>hello<tag>out="Greeting"</tag></item> </one-of> </rule> </grammar>
<?xml version="1.0" encoding="UTF-8" ?> <grammar xmlns="http://www.w3.org/2001/06/grammar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/06/grammar http://www.w3.org/TR/speech-grammar/grammar.xsd" xml:lang="en-US" version="1.0" root="main" mode="voice" tag-format="semantics/1.0"> <rule id="main" scope="public"> <tag>out=""</tag> <ruleref uri="#text"/><tag>out = rules.text</tag> </rule> <rule id="text"> <one-of> <item>Hmm<tag>out="Waiting for your input"</tag></item> <item>Mmm<tag>out="Waiting for your input"</tag></item> <item>Can you please wait<tag>out="Waiting for your input"</tag></item> </one-of> </rule> </grammar>