-
Notifications
You must be signed in to change notification settings - Fork 0
/
date.xml
264 lines (258 loc) · 5.01 KB
/
date.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<?xml version="1.0" encoding="ISO-8859-1"?>
<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"
version="1.0" xml:lang="en-US" mode="voice" root="main">
<!-- original from https://gist.github.com/mheadd/793456/raw/89a41d1735487c215fdd0bbb43801aa78d19b7e1/date.xml -->
<!-- Main gramar rule -->
<rule id="main" scope="public">
<one-of>
<item> <ruleref uri="#HumanDates" /> </item>
<item> <ruleref uri="#MonthDayYear" /> </item>
</one-of>
</rule>
<!-- Sub rule for 'Human' dates like today, yesterday, two days ago, Monday, etc. -->
<rule id="HumanDates" scope="private">
<one-of>
<item>today</item>
<item>yesterday</item>
</one-of>
</rule>
<!-- Sub rule for Month Day Year -->
<rule id="MonthDayYear" scope="private">
<tag>$="";</tag>
<item>
<ruleref uri="#month" />
<tag>$ = $ + $month;</tag>
</item>
<item>
<ruleref uri="#day" />
<tag>$ = $ + "/" + $day;</tag>
</item>
<item>
<ruleref uri="#year" />
<tag>$ = $ + "/" + $year;</tag>
</item>
</rule>
<!-- Sub rule for month -->
<rule id="month" scope="private">
<tag>$="";</tag>
<one-of>
<item>
january
<tag>$ = $ + "01";</tag>
</item>
<item>
february
<tag>$ = $ + "02";</tag>
</item>
<item>
march
<tag>$ = $ + "03";</tag>
</item>
<item>
april
<tag>$ = $ + "04";</tag>
</item>
<item>
may
<tag>$ = $ + "05";</tag>
</item>
<item>
june
<tag>$ = $ + "06";</tag>
</item>
<item>
july
<tag>$ = $ + "07";</tag>
</item>
<item>
august
<tag>$ = $ + "08";</tag>
</item>
<item>
september
<tag>$ = $ + "09";</tag>
</item>
<item>
october
<tag>$ = $ + "10";</tag>
</item>
<item>
november
<tag>$ = $ + "11";</tag>
</item>
<item>
december
<tag>$ = $ + "12";</tag>
</item>
</one-of>
</rule>
<!-- Sub rule for day -->
<rule id="day" scope="private">
<tag>$="";</tag>
<one-of>
<item>
first
<tag>$ = $ + "01";</tag>
</item>
<item>
second
<tag>$ = $ + "02";</tag>
</item>
<item>
third
<tag>$ = $ + "03";</tag>
</item>
<item>
fourth
<tag>$ = $ + "04";</tag>
</item>
<item>
fifth
<tag>$ = $ + "05";</tag>
</item>
<item>
sixth
<tag>$ = $ + "06";</tag>
</item>
<item>
seventh
<tag>$ = $ + "07";</tag>
</item>
<item>
eight
<tag>$ = $ + "08";</tag>
</item>
<item>
ninth
<tag>$ = $ + "09";</tag>
</item>
<item>
tenth
<tag>$ = $ + "10";</tag>
</item>
<item>
eleventh
<tag>$ = $ + "11";</tag>
</item>
<item>
twetlth
<tag>$ = $ + "12";</tag>
</item>
<item>
thirteenth
<tag>$ = $ + "13";</tag>
</item>
<item>
fourteenth
<tag>$ = $ + "14";</tag>
</item>
<item>
fifteenth
<tag>$ = $ + "15";</tag>
</item>
<item>
sisteenth
<tag>$ = $ + "16";</tag>
</item>
<item>
seventeenth
<tag>$ = $ + "17";</tag>
</item>
<item>
eighteenth
<tag>$ = $ + "18";</tag>
</item>
<item>
ninteenth
<tag>$ = $ + "19";</tag>
</item>
<item>
twentieth
<tag>$ = $ + "20";</tag>
</item>
<item>
twenty first
<tag>$ = $ + "21";</tag>
</item>
<item>
twenty second
<tag>$ = $ + "22";</tag>
</item>
<item>
twenty third
<tag>$ = $ + "23";</tag>
</item>
<item>
twenth fourth
<tag>$ = $ + "24";</tag>
</item>
<item>
twenty fifth
<tag>$ = $ + "25";</tag>
</item>
<item>
twenth sixth
<tag>$ = $ + "26";</tag>
</item>
<item>
twenty seventh
<tag>$ = $ + "27";</tag>
</item>
<item>
twenty eighth
<tag>$ = $ + "28";</tag>
</item>
<item>
twenty ninth
<tag>$ = $ + "29";</tag>
</item>
<item>
thirtieth
<tag>$ = $ + "30";</tag>
</item>
<item>
thirty first
<tag>$ = $ + "31";</tag>
</item>
</one-of>
</rule>
<!-- Sub rule for year -->
<rule id="year" scope="private">
<tag>$="";</tag>
<one-of>
<item>
two thousand eleven
<tag>$ = $ + "2011";</tag>
</item>
<item>
two thousand twelve
<tag>$ = $ + "2012";</tag>
</item>
<item>
two thousand thirteen
<tag>$ = $ + "2013";</tag>
</item>
<item>
two thousand fourteen
<tag>$ = $ + "2014";</tag>
</item>
<item>
two thousand fifteen
<tag>$ = $ + "2015";</tag>
</item>
<item>
two thousand sixteen
<tag>$ = $ + "2016";</tag>
</item>
<item>
two thousand seventeen
<tag>$ = $ + "2017";</tag>
</item>
<item>
two thousand eighteen
<tag>$ = $ + "2018";</tag>
</item>
</one-of>
</rule>
</grammar>