1#[non_exhaustive]
5#[derive(Clone, Debug)]
6pub enum LANGUAGE {
7 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
8 Arabic,
10
11 #[cfg(feature = "nltk")]
12 Azerbaijani,
14
15 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
16 Danish,
18
19 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
20 Dutch,
22
23 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
24 English,
26
27 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
28 Finnish,
30
31 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
32 French,
34
35 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
36 German,
38
39 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
40 Greek,
42
43 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
44 Hungarian,
46
47 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
48 Indonesian,
50
51 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
52 Italian,
54
55 #[cfg(feature = "nltk")]
56 Kazakh,
58
59 #[cfg(feature = "nltk")]
60 Nepali,
62
63 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
64 Norwegian,
66
67 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
68 Portuguese,
70
71 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
72 Romanian,
74
75 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
76 Russian,
78
79 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
80 Slovenian,
82
83 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
84 Spanish,
86
87 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
88 Swedish,
90
91 #[cfg(feature = "nltk")]
92 Tajik,
94
95 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
96 Turkish,
98
99 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
100 Afrikaans,
102
103 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
104 Armenian,
106
107 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
108 Basque,
110
111 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
112 Bengali,
114
115 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
116 Breton,
118
119 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
120 Bulgarian,
122
123 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
124 Catalan,
126
127 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
128 Czech,
130
131 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
132 Chinese,
134
135 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
136 Esperanto,
138
139 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
140 Estonian,
142
143 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
144 Persian,
146
147 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
148 Irish,
150
151 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
152 Galician,
154
155 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
156 Gujarati,
158
159 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
160 Hausa,
162
163 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
164 Hebrew,
166
167 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
168 Hindi,
170
171 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
172 Croatian,
174
175 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
176 Japanese,
178
179 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
180 Korean,
182
183 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
184 Kurdish,
186
187 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
188 Latin,
190
191 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
192 Latvian,
194
195 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
196 Lithuanian,
198
199 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
200 Marathi,
202
203 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
204 Malay,
206
207 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
208 Polish,
210
211 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
212 Slovak,
214
215 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
216 Somali,
218
219 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
220 Sotho,
222
223 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
224 Swahili,
226
227 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
228 Tagalog,
230
231 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
232 Thai,
234
235 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
236 Ukrainian,
238
239 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
240 Urdu,
242
243 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
244 Vietnamese,
246
247 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
248 Yoruba,
250
251 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
252 Zulu,
254
255 #[cfg(feature = "unimplemented")]
256 Afar,
258
259 #[cfg(feature = "constructed")]
260 Quenya,
262
263 #[cfg(feature = "constructed")]
264 Sindarin,
266
267 #[cfg(feature = "constructed")]
268 Klingon,
270
271 #[cfg(feature = "constructed")]
272 Dothraki,
274
275 #[cfg(feature = "constructed")]
276 Dovahzul,
278
279 #[cfg(feature = "constructed")]
280 Navi,
282
283 #[cfg(feature = "constructed")]
284 HighValyrian,
286}
287
288impl LANGUAGE {
289 #[must_use]
291 #[allow(clippy::too_many_lines)]
292 pub const fn as_str(&self) -> &'static str {
293 match self {
294 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
295 LANGUAGE::Arabic => "ar",
296 #[cfg(feature = "nltk")]
297 LANGUAGE::Azerbaijani => "az",
298 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
299 LANGUAGE::Danish => "da",
300 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
301 LANGUAGE::Dutch => "nl",
302 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
303 LANGUAGE::English => "en",
304 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
305 LANGUAGE::Finnish => "fi",
306 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
307 LANGUAGE::French => "fr",
308 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
309 LANGUAGE::German => "de",
310 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
311 LANGUAGE::Greek => "el",
312 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
313 LANGUAGE::Hungarian => "hu",
314 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
315 LANGUAGE::Indonesian => "id",
316 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
317 LANGUAGE::Italian => "it",
318 #[cfg(feature = "nltk")]
319 LANGUAGE::Kazakh => "kk",
320 #[cfg(feature = "nltk")]
321 LANGUAGE::Nepali => "ne",
322 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
323 LANGUAGE::Norwegian => "no",
324 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
325 LANGUAGE::Portuguese => "pt",
326 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
327 LANGUAGE::Romanian => "ro",
328 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
329 LANGUAGE::Russian => "ru",
330 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
331 LANGUAGE::Slovenian => "sl",
332 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
333 LANGUAGE::Spanish => "es",
334 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
335 LANGUAGE::Swedish => "sv",
336 #[cfg(feature = "nltk")]
337 LANGUAGE::Tajik => "tg",
338 #[cfg(all(any(feature = "nltk", feature = "iso"), not(feature = "constructed")))]
339 LANGUAGE::Turkish => "tr",
340 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
341 LANGUAGE::Afrikaans => "af",
342 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
343 LANGUAGE::Armenian => "hy",
344 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
345 LANGUAGE::Basque => "eu",
346 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
347 LANGUAGE::Bengali => "bn",
348 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
349 LANGUAGE::Breton => "br",
350 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
351 LANGUAGE::Bulgarian => "bg",
352 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
353 LANGUAGE::Catalan => "ca",
354 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
355 LANGUAGE::Czech => "cs",
356 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
357 LANGUAGE::Chinese => "zh",
358 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
359 LANGUAGE::Esperanto => "eo",
360 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
361 LANGUAGE::Estonian => "et",
362 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
363 LANGUAGE::Persian => "fa",
364 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
365 LANGUAGE::Irish => "ga",
366 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
367 LANGUAGE::Galician => "gl",
368 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
369 LANGUAGE::Gujarati => "gu",
370 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
371 LANGUAGE::Hausa => "ha",
372 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
373 LANGUAGE::Hebrew => "he",
374 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
375 LANGUAGE::Hindi => "hi",
376 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
377 LANGUAGE::Croatian => "hr",
378 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
379 LANGUAGE::Japanese => "ja",
380 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
381 LANGUAGE::Korean => "ko",
382 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
383 LANGUAGE::Kurdish => "ku",
384 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
385 LANGUAGE::Latin => "la",
386 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
387 LANGUAGE::Latvian => "lv",
388 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
389 LANGUAGE::Lithuanian => "lt",
390 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
391 LANGUAGE::Marathi => "mr",
392 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
393 LANGUAGE::Malay => "ms",
394 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
395 LANGUAGE::Polish => "pl",
396 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
397 LANGUAGE::Slovak => "sk",
398 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
399 LANGUAGE::Somali => "so",
400 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
401 LANGUAGE::Sotho => "st",
402 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
403 LANGUAGE::Swahili => "sw",
404 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
405 LANGUAGE::Tagalog => "tl",
406 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
407 LANGUAGE::Thai => "th",
408 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
409 LANGUAGE::Ukrainian => "uk",
410 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
411 LANGUAGE::Urdu => "ur",
412 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
413 LANGUAGE::Vietnamese => "vi",
414 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
415 LANGUAGE::Yoruba => "yo",
416 #[cfg(all(feature = "iso", not(feature = "nltk"), not(feature = "constructed")))]
417 LANGUAGE::Zulu => "zu",
418 #[cfg(feature = "unimplemented")]
419 LANGUAGE::Afar => "aa",
420 #[cfg(feature = "constructed")]
421 LANGUAGE::Quenya => "qya",
422 #[cfg(feature = "constructed")]
423 LANGUAGE::Sindarin => "sjn",
424 #[cfg(feature = "constructed")]
425 LANGUAGE::Klingon => "tlh",
426 #[cfg(feature = "constructed")]
427 LANGUAGE::Dothraki => "dot",
428 #[cfg(feature = "constructed")]
429 LANGUAGE::Dovahzul => "dov",
430 #[cfg(feature = "constructed")]
431 LANGUAGE::Navi => "nav",
432 #[cfg(feature = "constructed")]
433 LANGUAGE::HighValyrian => "val",
434 }
435 }
436}
437
438impl From<LANGUAGE> for String {
439 fn from(value: LANGUAGE) -> Self {
440 value.as_str().to_owned()
441 }
442}
443
444impl AsRef<str> for LANGUAGE {
445 fn as_ref(&self) -> &str {
446 self.as_str()
447 }
448}
449
450impl std::fmt::Display for LANGUAGE {
451 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
452 f.write_str(self.as_ref())
453 }
454}