-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcodes.lisp
115 lines (113 loc) · 2.74 KB
/
codes.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
(in-package #:org.shirakumo.maiden.agents.talk)
(defvar *language-code-map*
'(("Afrikaans" . "af")
("Albanian" . "sq")
("Amharic" . "am")
("Arabic" . "ar")
("Armenian" . "hy")
("Azeerbaijani" . "az")
("Basque" . "eu")
("Belarusian" . "be")
("Bengali" . "bn")
("Bosnian" . "bs")
("Bulgarian" . "bg")
("Catalan" . "ca")
("Cebuano" . "ceb")
("Chichewa" . "ny")
("Chinese" . "zh")
("Simplified Chinese" . "zh-CN")
("Traditional Chinese" . "zh-TW")
("Corsican" . "co")
("Croatian" . "hr")
("Czech" . "cs")
("Danish" . "da")
("Dutch" . "nl")
("English" . "en")
("Esperanto" . "eo")
("Estonian" . "et")
("Filipino" . "tl")
("Finnish" . "fi")
("French" . "fr")
("Frisian" . "fy")
("Galician" . "gl")
("Georgian" . "ka")
("German" . "de")
("Greek" . "el")
("Gujarati" . "gu")
("Haitian Creole" . "ht")
("Hausa" . "ha")
("Hawaiian" . "haw")
("Hebrew" . "iw")
("Hindi" . "hi")
("Hmong" . "hmn")
("Hungarian" . "hu")
("Icelandic" . "is")
("Igbo" . "ig")
("Indonesian" . "id")
("Irish" . "ga")
("Italian" . "it")
("Japanese" . "ja")
("Javanese" . "jw")
("Kannada" . "kn")
("Kazakh" . "kk")
("Khmer" . "km")
("Korean" . "ko")
("Kurdish" . "ku")
("Kyrgyz" . "ky")
("Lao" . "lo")
("Latin" . "la")
("Latvian" . "lv")
("Lithuanian" . "lt")
("Luxembourgish" . "lb")
("Macedonian" . "mk")
("Malagasy" . "mg")
("Malay" . "ms")
("Malayalam" . "ml")
("Maltese" . "mt")
("Maori" . "mi")
("Marathi" . "mr")
("Mongolian" . "mn")
("Burmese" . "my")
("Nepali" . "ne")
("Norwegian" . "no")
("Pashto" . "ps")
("Persian" . "fa")
("Polish" . "pl")
("Portuguese" . "pt")
("Punjabi" . "ma")
("Romanian" . "ro")
("Russian" . "ru")
("Samoan" . "sm")
("Scots Gaelic" . "gd")
("Serbian" . "sr")
("Sesotho" . "st")
("Shona" . "sn")
("Sindhi" . "sd")
("Sinhala" . "si")
("Slovak" . "sk")
("Slovenian" . "sl")
("Somali" . "so")
("Spanish" . "es")
("Sundanese" . "su")
("Swahili" . "sw")
("Swedish" . "sv")
("Tajik" . "tg")
("Tamil" . "ta")
("Telugu" . "te")
("Thai" . "th")
("Turkish" . "tr")
("Ukrainian" . "uk")
("Urdu" . "ur")
("Uzbek" . "uz")
("Vietnamese" . "vi")
("Welsh" . "cy")
("Xhosa" . "xh")
("Yiddish" . "yi")
("Yoruba" . "yo")
("Zulu" . "zu")))
(defun language-code (language)
(or (loop for (name . code) in *language-code-map*
do (when (or (search language name :test #'char-equal)
(search name language :test #'char-equal))
(return code)))
language))