-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathviet-practice.lisp
400 lines (375 loc) · 12.1 KB
/
viet-practice.lisp
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
;; http://paste.lisp.org/+742R
(uiop:define-package :fare-scripts/viet-practice
(:use :common-lisp :uiop :fare-utils :optima :optima.ppcre :cl-unicode)
(:export
#:practice))
(in-package :fare-scripts/viet-practice)
(defun practice (list)
(loop do (loop with copy = (copy-list list)
until (null copy)
do (let ((entry (elt copy (random (length copy)))))
(setf copy (remove entry copy))
(format t "~a~%" (car entry))
(if (equal (read-line) (cdr entry))
(format t "correct~%")
(progn (format t "try again~%")
(if (equal (read-line) (cdr entry))
(format t "correct~%")
(format t "no, the answer is: ~a~%" (cdr entry)))))))))
(defparameter *weather*
'(("weather" . "thời tiết")
("warm or hot, as in the weather is hot~%or the coffee is hot"
. "nóng")
("warm(ish), as in the weather is pleasantly warm"
. "ấm")
("(very) cold"
. "lạnh")
("cool, as in the weather is pleasantly cool"
. "mát")
("humid, damp, of weather for instance"
. "ẩm")
("dry, of weather, but also dried fruit"
. "khô")
("sunny"
. "nắng")
("rainy"
. "mưa")
("windy"
. "gió")))
(defparameter *colors*
'(("red" . "đỏ")
("black" . "đen")
("green" . "xanh lá cây")
("blue (as the sky)" . "xanh da trời")
("blue (as the sea)" . "xanh nước biển")
("blue (light blue or green as banana leaves)" . "xanh lơ")
("white" . "trắng")
("yellow" . "vàng")
("orange" . "da cam")
("purple" . "tím")
("brown" . "nâu")
("gray (mixture between black and white)" . "ghi")
("gray (usual)" . "xám")
("indigo blue" . "lam")
("pink" . "hồng")))
(defparameter *sizes*
'(("tall (for people and things), large (for things))" . "lớn")
("small (for people or things)" . "bé")
("short (for people or things)" . "thấp")
("short (for things (like pants))" . "ngắn")
("big (for things) fat (for people)" . "to")
("small (for people or things), thin (for people)" . "nhỏ")
("wide (for things)" . "rộng")
("narrow (for things)" . "hẹp")
("fat (of a person or an animal)" . "béo")
("thin (of a person or an animal)" . "gầy")
("thick" . "dày")
("long" . "dài")
))
(defparameter *tastes*
'(("sour" . "chua")
("sweet" . "ngọt")
("hot, peppery" . "cay")
("bitter" . "đắng")
("salty" . "mặn")
("tasty, good" . "ngon")))
(defparameter *adjectives*
(append *weather* *colors* *sizes* *tastes*))
(defparameter *relative-positions*
'(("next to" . "ở cạnh")
("between" . "ở giữa")
("opposite" . "đối diện với")
("at the street corner" . "ở góc phố")
("in front of" . "ở phía trước")
("behind" . "ở phía sau")))
(defparameter *directions*
'(("go straight ahead" . "đi thẳng")
("turn right" . "rẽ phải")
("turn left" . "rẽ trái")
("four-way street" . "ngã tư")
("three-way street" . "ngã ba")
("go through, traverse" . "đi qua")
("to the right of" . "bên phải")
("to the left of" . "bên trái")
("return, turn back, make a u-turn" . "quay lại")
("near" . "ở gần")
("to be lost" . "bị lạc")
("continue" . "tiếp tục")
("go up, step up" . "lên")
("go down, step down" . "xuống")
))
(defparameter *places*
'(("bank" . "ngân hàng")
("restaurant" . "nhà hàng")
("hotel" . "khách sạn")
("public park, public garden" . "công viên")
("supermarket" . "siêu thị")
("market" . "chợ")
("church, cathedral" . "nhà thờ")
("club" . "câu lạc bộ")
("foreign language center" . "trung tâm ngoại ngữ")
("university" . "đại học")
("elementary school (6-11)" . "trường tiểu học")
("middle school (12-15)" . "trường trung học cơ sở")
("high school" . "trung học")
("filling station" . "trạm xăng")
("movie theater" . "rạp chiếu phim")
("museum, maosoleum" . "bảo tàng")
("bus stop" . "bến xe bus")
("tram stop" . "bến tàu điện")
("library" . "thư viện")
("theater" . "nhà hát")
("hospital" . "bệnh viện")
("book store" . "hiệu sách")
("railway station" . "ga")
("airport" . "sân bay")))
(defparameter *part-of-day*
'(("morning" . "buổi sáng")
("noon" . "buổi trưa")
("afternoon" . "buổi chiều")
("evening, night" . "buổi tối")))
(defparameter *time-date*
'(("year" . "năm")
("month" . "tháng")
("week" . "tuần")
("day" . "ngày")
("hour" . "giờ")
("minute" . "phút")
("second" . "giây")
("tomorrow" . "ngày mai")
("yesterday" . "hôm qua")
("the day after tomorrow" . "ngày kia")
("the day before yesterday" . "hôm kia")
("the day after the day after tomorrow" . "ngày kìa")
("the day before the day before yesterday" . "hôm kìa")
("last, previous (week, month)" . "trước")
("next (week, month) (1)" . "tới")
("next (week, month) (2)" . "sau")
("the preceding day" . "hôm trưóc")
("the following day" . "hôm tới")
("today" . "hôm nay")
("minus (x o'clock minus y minutes" . "kém")
("this week" . "tuần náy")
("this month" . "tháng này")
("this year" . "năm nay")
("never (1)" . "không bao giờ")
("never (2)" . "chưa bao giờ")
))
(defparameter *vehicles*
'(("car, automobile" . "xe ô tô")
("bus" . "xe buýt")
("train xe ..." . "xe lửa")
("train tàu ..." . "tàu hoả")
("TGV" . "tàu cau tốc")
("tram" . "tàu điện")
("subway, metro" . "tàu diện ngầm")
("bicycle" . "xe đạp")
("cycle tri-shaw" . "xích lô")
("motorbike" . "xe máy")
("scooter taxi" . "xe ôm")
("airplane" . "máy bay")
("truck, lorry" . "xe tải")
("(small) boat" . "thuyền")
("steam boat, steamer, (large) boat" . "tàu thủy")))
(defparameter *countries*
'(("Algeria" . "An giê ri")
("Morocco" . "Ma Rốc")
("Sweden" . "Thụy Điển" )
("Denmark" . "Đan Mạch")
("Finland" . "Phần Lan")
("Norway" . "Na Uy")
("Iceland" . "Ai-xơ-len")
("England, United Kingdom" . "Anh")
("Belgium" . "Bỉ")
("Netherlands" . "Hà Lan")
;; ("Luxemburg" . "")
("France" . "Pháp")
("Germany" . "Đức")
("Spain" . "Tây Ban Nha")
("Portugal" . "Bồ Đào Nha")
("Italy" . "Ý")
("Greece" . "Hy Lạp")
("Austria" . "Áo")
("Switzerland" . "Thụy Sĩ")
("Poland" . "Ba Lan")
("Turkey" . "Thổ Nhĩ Kỳ")
;; ("Tcheque Republic" . "")
;; ("Slovakia" . "")
;; ("Hungary" . "")
("USA" . "Mỹ")
("Canada" . "Canada")
;; ("Brezil" . "")
("Vietnam" . "Việt Nam")
("China" . "Trung Quốc")
("Cambodia" . "Campuchia")
("Thailand" . "Thái Lan")
("Laos" . "Lào")
("Australia" . "Úc")
("Japan" . "Nhật Bản")
("India" . "Ấn Đô")
;; ("New Zealand" . "")
))
(defparameter *clothes*
'(("throw on a scarf" . "quàng khăn")
("wear eye glasses" . "đeo kính")
("wear a bracelet, necklace" . "đeo vòng")
("wear a tie" . "thắt cà vạt")
("wear a skirt" . "mặc váy")
("wear trousers" . "mặc quần")
("wear a blouse, shirt, jacket" . "mặc áo")
("wear a hat" . "đội nón")
("wear a cap" . "đội mũ")
("wear shoes, boots" . "đi giày")
("wear sandals slippers" . "đi dép")
("wear tongs" . "đi tông")
("be barefoot" . "đi chân đất")
))
(defparameter *set-phrases*
'(("not only ... but ..." . "không chỉ ... mà ...")
("because ... it is the case that ..." . "do ... nên ...")
("if ... then ..." . "nếu ... thì ...")
("help me by ..." . "để tôi ... giúp em")
("would you like me to help you ..." . "em ... giúp tôi được không")
("from ... to ..." . "từ ... đến ...")
("do something together with someone else" . "cùng với")
("do something together" . "cùng nhau")
;; ("" . "")
))
(defparameter *animals*
'(("pig, pork" . "heo")
("cow, beef" . "bò")
("chicken" . "gà")
("fish" . "cá")
("salmon" . "cá hồi")
("shrimp" . "tôm")
("prawn" . "tôm he")
("lobster" . "tôm hùm")
("crab" . "cua")
("duck" . "vịt")
("wild goose" . "ngan")
))
(defparameter *food*
'(("vegetables, greens" . "rau")
("meat" . "thịt")
("soup" . "canh")
("salad" . "xà lách")
("cooked rice, boiled rice" . "cơm")
("rice porridge" . "cháo")
("bindweed, spinach" . "rau muống")
("sweet potato, taro" . "khoai")
("potato" . "khoai tây")
("imperial spring rolls" . "nem đế")
("Saigon spring roll" . "chả giò")
("raw Saigon spring roll" . "chả giò sống")
("raw spring roll" . "gỏi sống")
("liver" . "gan")
("side, ribs, spare ribs" . "xương sườn")
;; ("hot pot" . "")
;; ("morning glory" . "")
("bread" . "bánh mì")
("cheese" . "phó mát")
("butter" . "bơ")
("milk" . "sữa")
("sugar" . "đường")
("fruit" . "quả")
("dragon fruit" . "thanh long")
("mango (fruit)" . "xoài")
("lychee (fruit)" . "vải")
("longan (fruit)" . "long nhãn")
("orange (fruit)" . "cam")
("lemon (fruit)" . "chanh")
("apple (fruit)" . "bôm")
("banana (fruit)" . "chuối")
("coconut" . "dừa")
("orange juice" . "nước cam")
("coconut milk" . "nước dừa")
;; ("apple juice" . "")
("lemonade" . "nưóc chanh")
("coffee" . "cà phê")
("tea" . "trà")
("wine" . "vang")
("beer" . "bia")
("dish, course" . "món")
("strir fry (with onions and vegetables)" . "xào")
("special dish" . "đặc sản")
("menu" . "thực đơn")
("check please" . "")
("ice" . "đá")
("hungry" . "đói")
("thirsty" . "khát")
))
(defparameter *misc*
'(("if" . "nếu")
("then" . "thì")
("only" . "chỉ")
("but" . "nhưng")
("like" . "như")
("usually, often, always, several" . "những")
("why" . "tại sao")
("because" . "bởi vì")
("can, be able to, possible" . "có thể")
("all, the whole of" . "tất cả")
("choose" . "chọn")
("friendly" . "thân thiện")
("never (1)" . "không bao giờ")
("never (2)" . "chưa bao giờ")
("how?" . "thế nào")
("the end of something" . "cuối")
("ever since, since then" . "từ đấy")
("also, too, as well" . "cũng")
("so that, in order to" . "để")
("to remember" . "nhớ")
("to forget" . "quên")
("thing, object, article" . "đồ")
))
(defparameter *seasons*
'(("winter" . "mùa đong")
("summer" . "mùa hè")
("spring" . "mùa xuân")
("fall, autumn" . "mùa thu")
("rainy season" . "mùa mưa")
("dry season" . "mùa khô")
("sunny season" . "mùa nắng")
))
(defparameter *rooms*
'(("dining room" . "phòng ăn")
("public dining room" . "phòng ăn công cộng")
("ticket office " . "phòng bán vé")
("kitchen" . "phòng bếp")
("press room" . "phòng báo chí")
("bedroom" . "phòng ngủ")
("guest room" . "phòng khác")
("bathroom" . "phòng tắm")
("library" . "phòng đọc sách")
("workshop" . "xưởng")
("engine room" . "phòng máy")
("photo studio" . "phòng ảnh")
))
(defparameter *math*
'(("percent" . "phần trăm")
("plus, add" . "cộng")
("add, join, augment, increase" . "thêm")
("plus sign" . "dấu cộng")
;; ("subtract" . "")
))
(defparameter *body-parts*
'(("foot, leg" . "chân")
))
(defparameter *tourism*
'(("photograph" . "ảnh")
("take a picture" . "chup ảnh")
("air conditioning" . "máy lạnh")
("refrigerator" . "tủ lạnh")
("to pay" . "trả")
("telephone" . "điện thoại")
("luxurious" . "sang trọng")
("bank card; credit card" . "thẻ ngân hàng")
("cash" . "tiền mặt")
("withdraw cash" . "rút tiền mặt")
("(national) police" . "cảnh sát")
("(municipal) police" . "công an")
("to visit" . "thăm")
("cheap" . "rẻ")
("expensive (1)" . "mắc")
("expensive (2)" . "đắt đỏ")
))