Home | History | Annotate | Download | only in grammars
      1 <?xml version="1.0" encoding="ISO8859-1" ?>
      2 <grammar xml:lang="en-us" version="1.0" root="ROOT">
      3 <meta name="word_penalty" content="40" />
      4 
      5 <rule id="ROOT" scope="public">
      6   <one-of>
      7     <item> <ruleref uri="#DIAL_NANP_3"/> <tag>meaning=DIAL_NANP_3.CMD;</tag> </item> 
      8     <item> <ruleref uri="#DIAL_NANP_7"/> <tag>meaning=DIAL_NANP_7.CMD;</tag> </item> 
      9     <item> <ruleref uri="#DIAL_NANP_10"/> <tag>meaning=DIAL_NANP_10.CMD;</tag> </item> 
     10     <item> <ruleref uri="#DIAL_INTNL"/> <tag>meaning=DIAL_INTNL.CMD;</tag> </item>
     11     <item> <ruleref uri="#CALL"/> <tag>meaning=CALL.CMD;</tag> </item>
     12     <item> Call Voice Mail <tag>meaning='voicemail'</tag> </item>
     13     <item> Redial <tag>meaning='redial'</tag> </item>
     14     <item> Exit <tag>meaning='X'</tag> </item>
     15     <item> Cancel <tag>meaning='X'</tag> </item>
     16     <item> <ruleref uri="#OPEN"/> <tag>meaning=OPEN.CMD;</tag> </item>
     17   </one-of>
     18 </rule>
     19 
     20 <rule id="DIAL_NANP_3">
     21   <item> Dial <tag>CMD='DIAL '</tag> </item>
     22   
     23   <item> <ruleref uri="#DIGIT29"/> <tag>CMD=CMD+DIGIT29.V</tag> </item>
     24   <item> 1 <tag>CMD=CMD+'1'</tag> </item>
     25   <item> 1 <tag>CMD=CMD+'1'</tag> </item>
     26 </rule> 
     27 
     28 <rule id="DIAL_NANP_7">
     29   <item> Dial <tag>CMD='DIAL '</tag> </item>
     30   
     31   <item> <ruleref uri="#DIGIT29"/> <tag>CMD=CMD+DIGIT29.V</tag> </item>
     32   <item> <ruleref uri="#DIGIT09"/> <tag>CMD=CMD+DIGIT09.V</tag> </item>
     33   <item> <ruleref uri="#DIGIT09"/> <tag>CMD=CMD+DIGIT09.V</tag> </item>
     34   
     35   <item> <ruleref uri="#DIGIT09"/> <tag>CMD=CMD+DIGIT09.V</tag> </item>
     36   <one-of>
     37     <item>
     38       <item> <ruleref uri="#DIGIT09"/> <tag>CMD=CMD+DIGIT09.V</tag> </item>
     39       <item> <ruleref uri="#DIGIT09"/> <tag>CMD=CMD+DIGIT09.V</tag> </item>
     40       <item> <ruleref uri="#DIGIT09"/> <tag>CMD=CMD+DIGIT09.V</tag> </item>
     41     </item>
     42     <item> thousand <tag>CMD=CMD+'000'</tag> </item>
     43   </one-of>
     44 </rule> 
     45 
     46 <rule id="DIAL_NANP_10">
     47   <item> Dial <tag>CMD='DIAL '</tag> </item>
     48   
     49   <!-- ignore leading 1 -->
     50   <item repeat="0-1"> 1 </item>
     51   
     52   <!-- accept either xxx or 'eight hundred' -->
     53   <one-of>
     54     <item>
     55       <item> <ruleref uri="#DIGIT29"/> <tag>CMD=CMD+DIGIT29.V</tag> </item>
     56       <item> <ruleref uri="#DIGIT08"/> <tag>CMD=CMD+DIGIT08.V</tag> </item>
     57       <item> <ruleref uri="#DIGIT09"/> <tag>CMD=CMD+DIGIT09.V</tag> </item>
     58     </item>
     59     <item> 8 hundred <tag>CMD=CMD+'800'</tag> </item>
     60   </one-of>
     61   
     62   <item> <ruleref uri="#DIGIT29"/> <tag>CMD=CMD+DIGIT29.V</tag> </item>
     63   <item> <ruleref uri="#DIGIT09"/> <tag>CMD=CMD+DIGIT09.V</tag> </item>
     64   <item> <ruleref uri="#DIGIT09"/> <tag>CMD=CMD+DIGIT09.V</tag> </item>
     65   
     66   <item> <ruleref uri="#DIGIT09"/> <tag>CMD=CMD+DIGIT09.V</tag> </item>
     67   <one-of>
     68     <item>
     69       <item> <ruleref uri="#DIGIT09"/> <tag>CMD=CMD+DIGIT09.V</tag> </item>
     70       <item> <ruleref uri="#DIGIT09"/> <tag>CMD=CMD+DIGIT09.V</tag> </item>
     71       <item> <ruleref uri="#DIGIT09"/> <tag>CMD=CMD+DIGIT09.V</tag> </item>
     72     </item>
     73     <item> thousand <tag>CMD=CMD+'000'</tag> </item>
     74   </one-of>
     75 </rule> 
     76 
     77 <rule id="DIGIT09">
     78   <one-of>
     79     <item> 0 <tag>V='0'</tag> </item>
     80     <item> 1 <tag>V='1'</tag> </item>
     81     <item> 2 <tag>V='2'</tag> </item>
     82     <item> 3 <tag>V='3'</tag> </item>
     83     <item> 4 <tag>V='4'</tag> </item>
     84     <item> 5 <tag>V='5'</tag> </item>
     85     <item> 6 <tag>V='6'</tag> </item>
     86     <item> 7 <tag>V='7'</tag> </item>
     87     <item> 8 <tag>V='8'</tag> </item>
     88     <item> 9 <tag>V='9'</tag> </item>
     89   </one-of>
     90 </rule> 
     91 
     92 <rule id="DIGIT08">
     93   <one-of>
     94     <item> 0 <tag>V='0'</tag> </item>
     95     <item> 1 <tag>V='1'</tag> </item>
     96     <item> 2 <tag>V='2'</tag> </item>
     97     <item> 3 <tag>V='3'</tag> </item>
     98     <item> 4 <tag>V='4'</tag> </item>
     99     <item> 5 <tag>V='5'</tag> </item>
    100     <item> 6 <tag>V='6'</tag> </item>
    101     <item> 7 <tag>V='7'</tag> </item>
    102     <item> 8 <tag>V='8'</tag> </item>
    103   </one-of>
    104 </rule> 
    105 
    106 <rule id="DIGIT29">
    107   <one-of>
    108     <item> 2 <tag>V='2'</tag> </item>
    109     <item> 3 <tag>V='3'</tag> </item>
    110     <item> 4 <tag>V='4'</tag> </item>
    111     <item> 5 <tag>V='5'</tag> </item>
    112     <item> 6 <tag>V='6'</tag> </item>
    113     <item> 7 <tag>V='7'</tag> </item>
    114     <item> 8 <tag>V='8'</tag> </item>
    115     <item> 9 <tag>V='9'</tag> </item>
    116   </one-of>
    117 </rule> 
    118 
    119 <rule id="DIAL_INTNL">
    120   <item> Dial Plus <tag>CMD='DIAL +';</tag> </item>
    121   <item repeat="5-15"> <ruleref uri="#DIGIT09"/> <tag>CMD=CMD+DIGIT09.V</tag> </item>
    122 </rule>
    123 
    124 <rule id="CALL">
    125   <item> Call <tag>CMD='CALL '</tag> </item>
    126   
    127   <item> <ruleref uri="#Names"/> <tag>CMD=CMD+Names.V</tag> </item>
    128   
    129   <item repeat="0-1">
    130     <one-of>
    131       <!-- corresponds to android.provider.Contacts.People.Phones.TYPE_HOME -->
    132       <item> at home <tag>CMD=CMD+' H'</tag> </item>
    133       <!-- corresponds to android.provider.Contacts.People.Phones.TYPE_MOBILE -->
    134       <item>
    135         <one-of> <item> at </item> <item> on </item> </one-of>
    136         <one-of> <item> cell </item> <item> mobile </item> </one-of>
    137         <tag>CMD=CMD+' M'</tag>
    138       </item>
    139       <!-- corresponds to android.provider.Contacts.People.Phones.TYPE_WORK -->
    140       <item> at work <tag>CMD=CMD+' W'</tag> </item>
    141       <!-- corresponds to android.provider.Contacts.People.Phones.TYPE_OTHER -->
    142       <item>
    143         <one-of> <item> at </item> <item> on </item> </one-of>
    144         <item> other </item>
    145         <tag>CMD=CMD+' O'</tag>
    146       </item>
    147     </one-of>
    148   </item>
    149 </rule> 
    150 
    151 <rule id="Names" scope="public">
    152   <item>__Names__</item>
    153 </rule>
    154 
    155 <rule id="OPEN">
    156   <item> Open <tag>CMD='OPEN ';</tag> </item>
    157   <item> <ruleref uri="#Opens"/> <tag>CMD=CMD+Opens.V</tag> </item>
    158 </rule>
    159 
    160 <rule id="Opens" scope="public">
    161   <item>__Opens__</item>
    162 </rule>
    163 
    164 </grammar>
    165