1 <?xml version="1.0" encoding="ISO8859-1" ?> 2 <!-- 3 Test grammar, this grammar demonstrates the use of voicetags and 4 texttags added to the grammar. It also demonstrates how multiple 5 literals can be mapped to the same meaning. 6 --> 7 <grammar xml:lang="en-us" version="1.0" root="ROOT"> 8 <meta name="word_penalty" content="40" /> 9 10 <rule id="ROOT" scope="public"> 11 <one-of> 12 <item><ruleref uri="#Phone"/> 13 <tag>meaning=Phone.V;</tag> 14 </item> 15 <item><ruleref uri="#Find"/> 16 <tag>meaning=Find.V;</tag> 17 </item> 18 <item><ruleref uri="#OtherCommands"/> 19 <tag>meaning=OtherCommands.V;</tag> 20 </item> 21 </one-of> 22 </rule> 23 24 <rule id="Phone"> 25 <item> 26 <item> 27 <item repeat="0-1">phone</item> 28 <item> 29 <one-of> 30 <item> 31 enter 32 <tag>C='ENTER ';</tag> 33 </item> 34 <item> 35 delete 36 <tag>C='DEL ';</tag> 37 </item> 38 <item> 39 remove 40 <tag>C='DEL ';</tag> 41 </item> 42 </one-of> 43 </item> 44 <item> 45 <ruleref uri="#Names"/> 46 <tag>V=Names.V;</tag> 47 </item> 48 </item> 49 <tag>C=(C?C:''); V=C+V;</tag> 50 </item> 51 </rule> 52 53 <rule id="Find"> 54 <item> 55 <item> 56 <item repeat="0-1"> 57 find 58 </item> 59 <item> 60 <ruleref uri="#Names"/> 61 <tag>V=Names.V;</tag> 62 </item> 63 </item> 64 <tag>C=(C?C:''); V=C+V;</tag> 65 </item> 66 </rule> 67 68 <rule id="Names" scope="public"> 69 <item>__Names__</item> 70 </rule> 71 72 <rule id="OtherCommands"> 73 <item> 74 <one-of> 75 <item> 76 hello 77 <tag>V='HI';</tag> 78 </item> 79 <item> 80 forward 81 <tag>V='FWD';</tag> 82 </item> 83 <item> 84 backward 85 <tag>V='BAK';</tag> 86 </item> 87 <item> 88 changer 89 <tag>V='CHANGER';</tag> 90 </item> 91 <item> 92 asterisk 93 <tag>V='STAR';</tag> 94 </item> 95 <item> 96 cd player 97 <tag>V='CDPL';</tag> 98 </item> 99 <item> 100 traffic information 101 <tag>V='TRFI';</tag> 102 </item> 103 <item> 104 traffic info 105 <tag>V='TRFI';</tag> 106 </item> 107 <item> 108 traffic 109 <tag>V='TRFI';</tag> 110 </item> 111 <item> 112 traffic memory 113 <tag>V='TRFM';</tag> 114 </item> 115 <item> 116 fahrenheit 117 <tag>V='DEGF';</tag> 118 </item> 119 <item> 120 celsius 121 <tag>V='DEGC';</tag> 122 </item> 123 </one-of> 124 <tag>C=(C?C:''); V=C+V;</tag> 125 </item> 126 </rule> 127 128 </grammar> 129