-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlists.aiml
200 lines (199 loc) · 6.83 KB
/
lists.aiml
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
<?xml version="1.0" encoding="UTF-8"?>
<aiml>
<category><pattern>SIMPLEMEMBER * *</pattern>
<template><think>
<set var="element"><star/></set>
<set var="list"><star index="2"/></set>
<set var="result">false</set>
</think>
<condition var="list">
<li var="list"><value>NIL</value><get var="result"/></li>
<li><think>
<set var="head"><first><get var="list"/></first></set>
<set var="list"><rest><get var="list"/></rest></set>
<condition var="head"><value><get var="element"/></value><set var="result">true</set></condition>
</think> <loop/></li>
</condition></template>
</category>
<topic name="REMOVE LIST ITEM">
<category><pattern>_</pattern><that>WHICH ITEM WOULD YOU LIKE TO REMOVE</that>
<template><think><set name="selecteditem"><star/></set>
<set name="topic">unknown</set>
</think>
<condition name="selecteditem">
<li value="None of the above"><srai><star/></srai></li>
<li><srai>REMOVE <star/> FROM LIST <get name="listname"/></srai></li>
</condition></template>
</category></topic>
<category><pattern>ADD _ TO LIST</pattern>
<template><srai>ADD <star/> TO MY LIST</srai></template>
</category>
<category><pattern>ADD _ TO MY LIST</pattern>
<template>I've added <star/> to your list.
<learn>
<category><pattern>MYLIST</pattern>
<template><eval><srai>CONS <star/> <srai>MYLIST</srai></srai></eval>
</template>
</category>
</learn></template>
</category>
<category><pattern>ADD _ TO MY * LIST</pattern>
<template>I've added <star/> to your <star index="2"/> list.
<learn>
<category><pattern>MY <eval><star index="2"/></eval> LIST</pattern>
<template><eval><srai>CONS <star/> <srai>MY <star index="2"/> LIST</srai></srai></eval>
</template>
</category>
</learn></template>
</category>
<category><pattern>LISTCAR *</pattern>
<template>undefined</template>
</category>
<category><pattern>LISTCAR CONS * CONS *</pattern>
<template><star/></template>
</category>
<category><pattern>LISTCAR CONS * NIL</pattern>
<template><star/></template>
</category>
<category><pattern>LISTCAR NIL</pattern>
<template>NIL</template>
</category>
<category><pattern>LISTCDR *</pattern>
<template>undefined</template>
</category>
<category><pattern>LISTCDR CONS * CONS *</pattern>
<template>CONS <star index="2"/></template>
</category>
<category><pattern>LISTCDR CONS * NIL</pattern>
<template>NIL</template>
</category>
<category><pattern>LISTCDR NIL</pattern>
<template>NIL</template>
</category>
<category><pattern>COMMASEPARATE *</pattern>
<template>undefined</template>
</category>
<category><pattern>COMMASEPARATE CONS * CONS *</pattern>
<template><star/>, <srai>COMMASEPARATE CONS <star index="2"/></srai></template>
</category>
<category><pattern>COMMASEPARATE CONS * NIL</pattern>
<template><star/></template>
</category>
<category><pattern>COMMASEPARATE NIL</pattern>
<template>Your list is empty.</template>
</category>
<category><pattern>CONS *</pattern>
<template>undefined</template>
</category>
<category><pattern>CONS * CONS *</pattern>
<template>CONS <star/> CONS <star index="2"/></template>
</category>
<category><pattern>CONS * NIL</pattern>
<template>CONS <star/> NIL</template>
</category>
<category><pattern>IS _ EQUALTO *</pattern>
<template><think><set var="star"><star/></set>
</think>
<condition var="star">
<li><value><star index="2"/></value>true</li>
<li>false</li>
</condition></template>
</category>
<category><pattern>LISTMEMBER * OF LIST CONS * CONS *</pattern>
<template><think><set name="isequalto"><srai>IS <star/> EQUALTO <star index="2"/></srai></set></think>
<condition name="isequalto">
<li value="true">true</li>
<li><srai>LISTMEMBER <star/> OF LIST CONS <star index="3"/></srai></li>
</condition></template>
</category>
<category><pattern>LISTMEMBER * OF LIST CONS * NIL</pattern>
<template><think><set name="isequalto"><srai>IS <star/> EQUALTO <star index="2"/></srai></set></think>
<condition name="isequalto">
<li value="true">true</li>
<li>false</li>
</condition></template>
</category>
<category><pattern>LISTMEMBER * OF LIST NIL</pattern>
<template>FALSE</template>
</category>
<category><pattern>MAKE A * LIST</pattern>
<template>Initializing your <star/> list.
<learn>
<category><pattern>MY <eval><star/></eval> LIST</pattern>
<template>NIL</template>
</category>
</learn></template>
</category>
<category><pattern>MAKE A LIST</pattern>
<template>Initializing your list.
<learn>
<category><pattern>MYLIST</pattern>
<template>NIL</template>
</category>
</learn></template>
</category>
<category><pattern>READ MY * LIST</pattern>
<template>Here is your <star/> list: <srai>COMMASEPARATE <srai>MY <star/> LIST</srai></srai></template>
</category>
<category><pattern>READ MY LIST</pattern>
<template>Here is your list: <srai>COMMASEPARATE <srai>MYLIST</srai></srai></template>
</category>
<category><pattern>REMOVE * FROM LIST *</pattern>
<template><think>
<set name="listname"><star index="2"/></set>
<set name="isamember"><srai>LISTMEMBER <star/> OF LIST <srai><get name="listname"/></srai></srai></set>
</think>
<!--
List name=<get name="listname"/>.
List value=<srai><get name="listname"/></srai>.
-->
<condition name="isamember">
<li value="true">Taking <star/> off your list.
<learn>
<category><pattern><eval><get name="listname"/></eval></pattern>
<template><eval><srai>REMOVEITEM <star/> FROM LIST <srai><get name="listname"/></srai></srai></eval></template>
</category>
</learn>
</li>
<li>
<oob><dialog>
<title>Which item?</title>
<list><srai>XMLITEMIZE <srai><get name="listname"/></srai></srai>
</list>
</dialog></oob>
<think><set name="topic">REMOVE LIST ITEM</set></think>
I couldn't find <star/> on your list.
Which item would you like to remove?
</li>
</condition></template>
</category>
<category><pattern>REMOVE * FROM MY * LIST</pattern>
<template><srai>REMOVE <star/> FROM LIST MY <star index="2"/> LIST</srai></template>
</category>
<category><pattern>REMOVE * FROM MY LIST</pattern>
<template><srai>REMOVE <star/> FROM LIST MYLIST</srai></template>
</category>
<category><pattern>REMOVEITEM * FROM LIST CONS * CONS *</pattern>
<template><think><set name="isequalto"><srai>IS <star/> EQUALTO <star index="2"/></srai></set></think>
<condition name="isequalto">
<li value="true"><srai>REMOVEITEM <star/> FROM LIST CONS <star index="3"/></srai></li>
<li>CONS <star index="2"/> <srai>REMOVEITEM <star/> FROM LIST CONS <star index="3"/></srai></li>
</condition></template>
</category>
<category><pattern>REMOVEITEM * FROM LIST CONS * NIL</pattern>
<template><think><set name="isequalto"><srai>IS <star/> EQUALTO <star index="2"/></srai></set></think>
<condition name="isequalto">
<li value="true">NIL</li>
<li>CONS <star index="2"/> NIL</li>
</condition></template>
</category>
<category><pattern>REMOVEITEM * FROM LIST NIL</pattern>
<template>NIL</template>
</category>
<category><pattern>WHAT IS MY LIST CALLED</pattern>
<template>Your list is called MYLIST.</template>
</category>
<category><pattern>YES</pattern><that>WOULD YOU LIKE TO MAKE A * LIST</that>
<template><srai>MAKE A <thatstar/> LIST</srai></template>
</category>
</aiml>