-
Notifications
You must be signed in to change notification settings - Fork 1
/
hw1_q2.xml
217 lines (195 loc) · 5.43 KB
/
hw1_q2.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
<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1">
<meta name="maintainer" content="[email protected]" />
<property name="grammarfetchint" value="prefetch" />
<property name="universals" value="help cancel exit repeat" />
<form id="City">
<block>
<prompt bargein="false"> Hi, my name is Gina </prompt>
</block>
<field name="City">
<prompt>
how are you today? Which city are you located?
</prompt>
<!-- Define the grammar. -->
<grammar xml:lang="en-us" root = "myrule">
<rule id="myrule">
<one-of>
<item> Seattle </item>
<item> San Diego </item>
</one-of>
</rule>
</grammar>
<!-- The user was silent, restart the field. -->
<noinput>
I did not hear anything. Please try again.
<reprompt/>
</noinput>
<!-- The user said something that was not defined in our grammar. -->
<nomatch>
I did not recognize that character. Please try again.
<reprompt/>
</nomatch>
</field>
<!-- Checks the "City" value against each of the valid values. -->
<filled namelist="City">
<if cond="City == 'Seattle'">
<prompt>
Seattle sounds like a cool place!
</prompt>
<goto next="#State"/>
<elseif cond="City == 'San Diego'" />
<prompt>
It's a beautiful place!
</prompt>
<goto next="#State"/>
<else/>
<prompt>
I'm sure you live on Mars!
</prompt>
</if>
</filled>
<!-- The help universal will always look for the <help> tags -->
<!-- when a help tag is found the execution will continue here -->
<help>
<prompt>
YAY you asked for help so I give you cheese burger
</prompt>
</help>
</form>
<form id="State">
<block>
<prompt bargein="false"> We will also need to know which state you live in. </prompt>
</block>
<field name="State">
<prompt>
Which state do you live in?
</prompt>
<!-- Define the grammar. -->
<grammar xml:lang="en-us" root = "myrule">
<rule id="myrule">
<one-of>
<item> Washington </item>
<item> California </item>
</one-of>
</rule>
</grammar>
<!-- The user was silent, restart the field. -->
<noinput>
I did not hear anything. Please try again.
<reprompt/>
</noinput>
<!-- The user said something that was not defined in our grammar. -->
<nomatch>
I did not recognize that character. Please try again.
<reprompt/>
</nomatch>
</field>
<!-- Checks the "State" value against each of the valid values. -->
<filled namelist="State">
<if cond="State == 'Washington'">
<goto next="#ForecastW"/>
<elseif cond="State == 'California'" />
<goto next="#ForecastC"/>
<else/>
<prompt>
That's interesting!
</prompt>
</if>
</filled>
</form>
<form id="ForecastC">
<field name="ForecastC">
<prompt>
Please choose from the following options. Do you want to weather forecast currently, shor-term or the long-term.
For current weather, say one. For short-term weather, say two. For the long-term weather, say three.
</prompt>
<!-- Define the grammar. -->
<grammar xml:lang="en-us" root = "myrule">
<rule id="myrule">
<one-of>
<item> one </item>
<item> two </item>
<item> three </item>
</one-of>
</rule>
</grammar>
<!-- The user was silent, restart the field. -->
<noinput>
I did not hear anything. Please try again.
<reprompt/>
</noinput>
<!-- The user said something that was not defined in our grammar. -->
<nomatch>
I did not recognize that character. Please try again.
<reprompt/>
</nomatch>
</field>
<!-- Checks the "ForecastC" value against each of the valid values. -->
<filled namelist="ForecastC">
<if cond="ForecastC == 'one'">
<prompt>
The weather in sunshine San Diego California currently is sunny.
Have a nice day!
</prompt>
<elseif cond="ForecastC == 'two'" />
<prompt>
The weather in sunshine San Diego California is mostly sunny.
Have a nice day!
</prompt>
<else/>
<prompt>
The weather in sunshine San Diego California is always sunny!
Have a nice day!
</prompt>
</if>
</filled>
</form>
<form id="ForecastW">
<field name="ForecastW">
<prompt>
Please choose from the following options. Do you want to weather forecast currently, shor-term or the long-term.
For current weather, say one. For short-term weather, say two. For the long-term weather, say three.
</prompt>
<!-- Define the grammar. -->
<grammar xml:lang="en-us" root = "myrule">
<rule id="myrule">
<one-of>
<item> one </item>
<item> two </item>
<item> three </item>
</one-of>
</rule>
</grammar>
<!-- The user was silent, restart the field. -->
<noinput>
I did not hear anything. Please try again.
<reprompt/>
</noinput>
<!-- The user said something that was not defined in our grammar. -->
<nomatch>
I did not recognize that character. Please try again.
<reprompt/>
</nomatch>
</field>
<!-- Checks the "ForecastW" value against each of the valid values. -->
<filled namelist="ForecastW">
<if cond="ForecastW == 'one'">
<prompt>
It is currently raining now in Seattle Washington currently.
Have a nice day!
</prompt>
<elseif cond="ForecastW == 'two'" />
<prompt>
It will be raining in Seattle Washington.
Have a nice day!
</prompt>
<else/>
<prompt>
It will always be raining in Seattle Washington.
Have a nice day!
</prompt>
</if>
</filled>
</form>
</vxml>