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