espeak-ng 0.1.1

Pure Rust port of eSpeak NG text-to-speech
Documentation
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
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
// This file is generated by scripts/generate_dict_crates.py.
// Do not edit manually.

use std::io;
use std::path::Path;

pub const BUNDLED_LANGUAGES: &[&str] = &[
    #[cfg(feature = "bundled-data-af")]
    "af",
    #[cfg(feature = "bundled-data-am")]
    "am",
    #[cfg(feature = "bundled-data-an")]
    "an",
    #[cfg(feature = "bundled-data-ar")]
    "ar",
    #[cfg(feature = "bundled-data-as")]
    "as",
    #[cfg(feature = "bundled-data-az")]
    "az",
    #[cfg(feature = "bundled-data-ba")]
    "ba",
    #[cfg(feature = "bundled-data-be")]
    "be",
    #[cfg(feature = "bundled-data-bg")]
    "bg",
    #[cfg(feature = "bundled-data-bn")]
    "bn",
    #[cfg(feature = "bundled-data-bpy")]
    "bpy",
    #[cfg(feature = "bundled-data-bs")]
    "bs",
    #[cfg(feature = "bundled-data-ca")]
    "ca",
    #[cfg(feature = "bundled-data-chr")]
    "chr",
    #[cfg(feature = "bundled-data-cmn")]
    "cmn",
    #[cfg(feature = "bundled-data-cs")]
    "cs",
    #[cfg(feature = "bundled-data-cv")]
    "cv",
    #[cfg(feature = "bundled-data-cy")]
    "cy",
    #[cfg(feature = "bundled-data-da")]
    "da",
    #[cfg(feature = "bundled-data-de")]
    "de",
    #[cfg(feature = "bundled-data-el")]
    "el",
    #[cfg(feature = "bundled-data-en")]
    "en",
    #[cfg(feature = "bundled-data-eo")]
    "eo",
    #[cfg(feature = "bundled-data-es")]
    "es",
    #[cfg(feature = "bundled-data-et")]
    "et",
    #[cfg(feature = "bundled-data-eu")]
    "eu",
    #[cfg(feature = "bundled-data-fa")]
    "fa",
    #[cfg(feature = "bundled-data-fi")]
    "fi",
    #[cfg(feature = "bundled-data-fr")]
    "fr",
    #[cfg(feature = "bundled-data-ga")]
    "ga",
    #[cfg(feature = "bundled-data-gd")]
    "gd",
    #[cfg(feature = "bundled-data-gn")]
    "gn",
    #[cfg(feature = "bundled-data-grc")]
    "grc",
    #[cfg(feature = "bundled-data-gu")]
    "gu",
    #[cfg(feature = "bundled-data-hak")]
    "hak",
    #[cfg(feature = "bundled-data-haw")]
    "haw",
    #[cfg(feature = "bundled-data-he")]
    "he",
    #[cfg(feature = "bundled-data-hi")]
    "hi",
    #[cfg(feature = "bundled-data-hr")]
    "hr",
    #[cfg(feature = "bundled-data-ht")]
    "ht",
    #[cfg(feature = "bundled-data-hu")]
    "hu",
    #[cfg(feature = "bundled-data-hy")]
    "hy",
    #[cfg(feature = "bundled-data-ia")]
    "ia",
    #[cfg(feature = "bundled-data-id")]
    "id",
    #[cfg(feature = "bundled-data-io")]
    "io",
    #[cfg(feature = "bundled-data-is")]
    "is",
    #[cfg(feature = "bundled-data-it")]
    "it",
    #[cfg(feature = "bundled-data-ja")]
    "ja",
    #[cfg(feature = "bundled-data-jbo")]
    "jbo",
    #[cfg(feature = "bundled-data-ka")]
    "ka",
    #[cfg(feature = "bundled-data-kk")]
    "kk",
    #[cfg(feature = "bundled-data-kl")]
    "kl",
    #[cfg(feature = "bundled-data-kn")]
    "kn",
    #[cfg(feature = "bundled-data-ko")]
    "ko",
    #[cfg(feature = "bundled-data-kok")]
    "kok",
    #[cfg(feature = "bundled-data-ku")]
    "ku",
    #[cfg(feature = "bundled-data-ky")]
    "ky",
    #[cfg(feature = "bundled-data-la")]
    "la",
    #[cfg(feature = "bundled-data-lb")]
    "lb",
    #[cfg(feature = "bundled-data-lfn")]
    "lfn",
    #[cfg(feature = "bundled-data-lt")]
    "lt",
    #[cfg(feature = "bundled-data-lv")]
    "lv",
    #[cfg(feature = "bundled-data-mi")]
    "mi",
    #[cfg(feature = "bundled-data-mk")]
    "mk",
    #[cfg(feature = "bundled-data-ml")]
    "ml",
    #[cfg(feature = "bundled-data-mr")]
    "mr",
    #[cfg(feature = "bundled-data-ms")]
    "ms",
    #[cfg(feature = "bundled-data-mt")]
    "mt",
    #[cfg(feature = "bundled-data-mto")]
    "mto",
    #[cfg(feature = "bundled-data-my")]
    "my",
    #[cfg(feature = "bundled-data-nci")]
    "nci",
    #[cfg(feature = "bundled-data-ne")]
    "ne",
    #[cfg(feature = "bundled-data-nl")]
    "nl",
    #[cfg(feature = "bundled-data-no")]
    "no",
    #[cfg(feature = "bundled-data-nog")]
    "nog",
    #[cfg(feature = "bundled-data-om")]
    "om",
    #[cfg(feature = "bundled-data-or")]
    "or",
    #[cfg(feature = "bundled-data-pa")]
    "pa",
    #[cfg(feature = "bundled-data-pap")]
    "pap",
    #[cfg(feature = "bundled-data-piqd")]
    "piqd",
    #[cfg(feature = "bundled-data-pl")]
    "pl",
    #[cfg(feature = "bundled-data-pt")]
    "pt",
    #[cfg(feature = "bundled-data-py")]
    "py",
    #[cfg(feature = "bundled-data-qdb")]
    "qdb",
    #[cfg(feature = "bundled-data-qu")]
    "qu",
    #[cfg(feature = "bundled-data-quc")]
    "quc",
    #[cfg(feature = "bundled-data-qya")]
    "qya",
    #[cfg(feature = "bundled-data-ro")]
    "ro",
    #[cfg(feature = "bundled-data-ru")]
    "ru",
    #[cfg(feature = "bundled-data-sd")]
    "sd",
    #[cfg(feature = "bundled-data-shn")]
    "shn",
    #[cfg(feature = "bundled-data-si")]
    "si",
    #[cfg(feature = "bundled-data-sjn")]
    "sjn",
    #[cfg(feature = "bundled-data-sk")]
    "sk",
    #[cfg(feature = "bundled-data-sl")]
    "sl",
    #[cfg(feature = "bundled-data-smj")]
    "smj",
    #[cfg(feature = "bundled-data-sq")]
    "sq",
    #[cfg(feature = "bundled-data-sr")]
    "sr",
    #[cfg(feature = "bundled-data-sv")]
    "sv",
    #[cfg(feature = "bundled-data-sw")]
    "sw",
    #[cfg(feature = "bundled-data-ta")]
    "ta",
    #[cfg(feature = "bundled-data-te")]
    "te",
    #[cfg(feature = "bundled-data-th")]
    "th",
    #[cfg(feature = "bundled-data-ti")]
    "ti",
    #[cfg(feature = "bundled-data-tk")]
    "tk",
    #[cfg(feature = "bundled-data-tn")]
    "tn",
    #[cfg(feature = "bundled-data-tr")]
    "tr",
    #[cfg(feature = "bundled-data-tt")]
    "tt",
    #[cfg(feature = "bundled-data-ug")]
    "ug",
    #[cfg(feature = "bundled-data-uk")]
    "uk",
    #[cfg(feature = "bundled-data-ur")]
    "ur",
    #[cfg(feature = "bundled-data-uz")]
    "uz",
    #[cfg(feature = "bundled-data-vi")]
    "vi",
    #[cfg(feature = "bundled-data-yue")]
    "yue",
];

pub fn bundled_languages() -> &'static [&'static str] {
    BUNDLED_LANGUAGES
}

pub fn has_bundled_language(lang: &str) -> bool {
    BUNDLED_LANGUAGES.contains(&lang)
}

fn unsupported_language_error(lang: &str) -> io::Error {
    let available = if BUNDLED_LANGUAGES.is_empty() {
        "none".to_string()
    } else {
        BUNDLED_LANGUAGES.join(", ")
    };
    io::Error::new(
        io::ErrorKind::InvalidInput,
        format!("language {lang:?} is not bundled in this build; enabled bundled languages: {available}"),
    )
}

#[allow(dead_code)]
#[cfg(any(feature = "bundled-data-af", feature = "bundled-data-am", feature = "bundled-data-an", feature = "bundled-data-ar", feature = "bundled-data-as", feature = "bundled-data-az", feature = "bundled-data-ba", feature = "bundled-data-be", feature = "bundled-data-bg", feature = "bundled-data-bn", feature = "bundled-data-bpy", feature = "bundled-data-bs", feature = "bundled-data-ca", feature = "bundled-data-chr", feature = "bundled-data-cmn", feature = "bundled-data-cs", feature = "bundled-data-cv", feature = "bundled-data-cy", feature = "bundled-data-da", feature = "bundled-data-de", feature = "bundled-data-el", feature = "bundled-data-en", feature = "bundled-data-eo", feature = "bundled-data-es", feature = "bundled-data-et", feature = "bundled-data-eu", feature = "bundled-data-fa", feature = "bundled-data-fi", feature = "bundled-data-fr", feature = "bundled-data-ga", feature = "bundled-data-gd", feature = "bundled-data-gn", feature = "bundled-data-grc", feature = "bundled-data-gu", feature = "bundled-data-hak", feature = "bundled-data-haw", feature = "bundled-data-he", feature = "bundled-data-hi", feature = "bundled-data-hr", feature = "bundled-data-ht", feature = "bundled-data-hu", feature = "bundled-data-hy", feature = "bundled-data-ia", feature = "bundled-data-id", feature = "bundled-data-io", feature = "bundled-data-is", feature = "bundled-data-it", feature = "bundled-data-ja", feature = "bundled-data-jbo", feature = "bundled-data-ka", feature = "bundled-data-kk", feature = "bundled-data-kl", feature = "bundled-data-kn", feature = "bundled-data-ko", feature = "bundled-data-kok", feature = "bundled-data-ku", feature = "bundled-data-ky", feature = "bundled-data-la", feature = "bundled-data-lb", feature = "bundled-data-lfn", feature = "bundled-data-lt", feature = "bundled-data-lv", feature = "bundled-data-mi", feature = "bundled-data-mk", feature = "bundled-data-ml", feature = "bundled-data-mr", feature = "bundled-data-ms", feature = "bundled-data-mt", feature = "bundled-data-mto", feature = "bundled-data-my", feature = "bundled-data-nci", feature = "bundled-data-ne", feature = "bundled-data-nl", feature = "bundled-data-no", feature = "bundled-data-nog", feature = "bundled-data-om", feature = "bundled-data-or", feature = "bundled-data-pa", feature = "bundled-data-pap", feature = "bundled-data-piqd", feature = "bundled-data-pl", feature = "bundled-data-pt", feature = "bundled-data-py", feature = "bundled-data-qdb", feature = "bundled-data-qu", feature = "bundled-data-quc", feature = "bundled-data-qya", feature = "bundled-data-ro", feature = "bundled-data-ru", feature = "bundled-data-sd", feature = "bundled-data-shn", feature = "bundled-data-si", feature = "bundled-data-sjn", feature = "bundled-data-sk", feature = "bundled-data-sl", feature = "bundled-data-smj", feature = "bundled-data-sq", feature = "bundled-data-sr", feature = "bundled-data-sv", feature = "bundled-data-sw", feature = "bundled-data-ta", feature = "bundled-data-te", feature = "bundled-data-th", feature = "bundled-data-ti", feature = "bundled-data-tk", feature = "bundled-data-tn", feature = "bundled-data-tr", feature = "bundled-data-tt", feature = "bundled-data-ug", feature = "bundled-data-uk", feature = "bundled-data-ur", feature = "bundled-data-uz", feature = "bundled-data-vi", feature = "bundled-data-yue"))]
fn install_selected_dictionary(dest_dir: &Path, lang: &str) -> io::Result<()> {
    match lang {
        #[cfg(feature = "bundled-data-af")]
        "af" => espeak_ng_data_dict_af::install(dest_dir),
        #[cfg(feature = "bundled-data-am")]
        "am" => espeak_ng_data_dict_am::install(dest_dir),
        #[cfg(feature = "bundled-data-an")]
        "an" => espeak_ng_data_dict_an::install(dest_dir),
        #[cfg(feature = "bundled-data-ar")]
        "ar" => espeak_ng_data_dict_ar::install(dest_dir),
        #[cfg(feature = "bundled-data-as")]
        "as" => espeak_ng_data_dict_as::install(dest_dir),
        #[cfg(feature = "bundled-data-az")]
        "az" => espeak_ng_data_dict_az::install(dest_dir),
        #[cfg(feature = "bundled-data-ba")]
        "ba" => espeak_ng_data_dict_ba::install(dest_dir),
        #[cfg(feature = "bundled-data-be")]
        "be" => espeak_ng_data_dict_be::install(dest_dir),
        #[cfg(feature = "bundled-data-bg")]
        "bg" => espeak_ng_data_dict_bg::install(dest_dir),
        #[cfg(feature = "bundled-data-bn")]
        "bn" => espeak_ng_data_dict_bn::install(dest_dir),
        #[cfg(feature = "bundled-data-bpy")]
        "bpy" => espeak_ng_data_dict_bpy::install(dest_dir),
        #[cfg(feature = "bundled-data-bs")]
        "bs" => espeak_ng_data_dict_bs::install(dest_dir),
        #[cfg(feature = "bundled-data-ca")]
        "ca" => espeak_ng_data_dict_ca::install(dest_dir),
        #[cfg(feature = "bundled-data-chr")]
        "chr" => espeak_ng_data_dict_chr::install(dest_dir),
        #[cfg(feature = "bundled-data-cmn")]
        "cmn" => espeak_ng_data_dict_cmn::install(dest_dir),
        #[cfg(feature = "bundled-data-cs")]
        "cs" => espeak_ng_data_dict_cs::install(dest_dir),
        #[cfg(feature = "bundled-data-cv")]
        "cv" => espeak_ng_data_dict_cv::install(dest_dir),
        #[cfg(feature = "bundled-data-cy")]
        "cy" => espeak_ng_data_dict_cy::install(dest_dir),
        #[cfg(feature = "bundled-data-da")]
        "da" => espeak_ng_data_dict_da::install(dest_dir),
        #[cfg(feature = "bundled-data-de")]
        "de" => espeak_ng_data_dict_de::install(dest_dir),
        #[cfg(feature = "bundled-data-el")]
        "el" => espeak_ng_data_dict_el::install(dest_dir),
        #[cfg(feature = "bundled-data-en")]
        "en" => espeak_ng_data_dict_en::install(dest_dir),
        #[cfg(feature = "bundled-data-eo")]
        "eo" => espeak_ng_data_dict_eo::install(dest_dir),
        #[cfg(feature = "bundled-data-es")]
        "es" => espeak_ng_data_dict_es::install(dest_dir),
        #[cfg(feature = "bundled-data-et")]
        "et" => espeak_ng_data_dict_et::install(dest_dir),
        #[cfg(feature = "bundled-data-eu")]
        "eu" => espeak_ng_data_dict_eu::install(dest_dir),
        #[cfg(feature = "bundled-data-fa")]
        "fa" => espeak_ng_data_dict_fa::install(dest_dir),
        #[cfg(feature = "bundled-data-fi")]
        "fi" => espeak_ng_data_dict_fi::install(dest_dir),
        #[cfg(feature = "bundled-data-fr")]
        "fr" => espeak_ng_data_dict_fr::install(dest_dir),
        #[cfg(feature = "bundled-data-ga")]
        "ga" => espeak_ng_data_dict_ga::install(dest_dir),
        #[cfg(feature = "bundled-data-gd")]
        "gd" => espeak_ng_data_dict_gd::install(dest_dir),
        #[cfg(feature = "bundled-data-gn")]
        "gn" => espeak_ng_data_dict_gn::install(dest_dir),
        #[cfg(feature = "bundled-data-grc")]
        "grc" => espeak_ng_data_dict_grc::install(dest_dir),
        #[cfg(feature = "bundled-data-gu")]
        "gu" => espeak_ng_data_dict_gu::install(dest_dir),
        #[cfg(feature = "bundled-data-hak")]
        "hak" => espeak_ng_data_dict_hak::install(dest_dir),
        #[cfg(feature = "bundled-data-haw")]
        "haw" => espeak_ng_data_dict_haw::install(dest_dir),
        #[cfg(feature = "bundled-data-he")]
        "he" => espeak_ng_data_dict_he::install(dest_dir),
        #[cfg(feature = "bundled-data-hi")]
        "hi" => espeak_ng_data_dict_hi::install(dest_dir),
        #[cfg(feature = "bundled-data-hr")]
        "hr" => espeak_ng_data_dict_hr::install(dest_dir),
        #[cfg(feature = "bundled-data-ht")]
        "ht" => espeak_ng_data_dict_ht::install(dest_dir),
        #[cfg(feature = "bundled-data-hu")]
        "hu" => espeak_ng_data_dict_hu::install(dest_dir),
        #[cfg(feature = "bundled-data-hy")]
        "hy" => espeak_ng_data_dict_hy::install(dest_dir),
        #[cfg(feature = "bundled-data-ia")]
        "ia" => espeak_ng_data_dict_ia::install(dest_dir),
        #[cfg(feature = "bundled-data-id")]
        "id" => espeak_ng_data_dict_id::install(dest_dir),
        #[cfg(feature = "bundled-data-io")]
        "io" => espeak_ng_data_dict_io::install(dest_dir),
        #[cfg(feature = "bundled-data-is")]
        "is" => espeak_ng_data_dict_is::install(dest_dir),
        #[cfg(feature = "bundled-data-it")]
        "it" => espeak_ng_data_dict_it::install(dest_dir),
        #[cfg(feature = "bundled-data-ja")]
        "ja" => espeak_ng_data_dict_ja::install(dest_dir),
        #[cfg(feature = "bundled-data-jbo")]
        "jbo" => espeak_ng_data_dict_jbo::install(dest_dir),
        #[cfg(feature = "bundled-data-ka")]
        "ka" => espeak_ng_data_dict_ka::install(dest_dir),
        #[cfg(feature = "bundled-data-kk")]
        "kk" => espeak_ng_data_dict_kk::install(dest_dir),
        #[cfg(feature = "bundled-data-kl")]
        "kl" => espeak_ng_data_dict_kl::install(dest_dir),
        #[cfg(feature = "bundled-data-kn")]
        "kn" => espeak_ng_data_dict_kn::install(dest_dir),
        #[cfg(feature = "bundled-data-ko")]
        "ko" => espeak_ng_data_dict_ko::install(dest_dir),
        #[cfg(feature = "bundled-data-kok")]
        "kok" => espeak_ng_data_dict_kok::install(dest_dir),
        #[cfg(feature = "bundled-data-ku")]
        "ku" => espeak_ng_data_dict_ku::install(dest_dir),
        #[cfg(feature = "bundled-data-ky")]
        "ky" => espeak_ng_data_dict_ky::install(dest_dir),
        #[cfg(feature = "bundled-data-la")]
        "la" => espeak_ng_data_dict_la::install(dest_dir),
        #[cfg(feature = "bundled-data-lb")]
        "lb" => espeak_ng_data_dict_lb::install(dest_dir),
        #[cfg(feature = "bundled-data-lfn")]
        "lfn" => espeak_ng_data_dict_lfn::install(dest_dir),
        #[cfg(feature = "bundled-data-lt")]
        "lt" => espeak_ng_data_dict_lt::install(dest_dir),
        #[cfg(feature = "bundled-data-lv")]
        "lv" => espeak_ng_data_dict_lv::install(dest_dir),
        #[cfg(feature = "bundled-data-mi")]
        "mi" => espeak_ng_data_dict_mi::install(dest_dir),
        #[cfg(feature = "bundled-data-mk")]
        "mk" => espeak_ng_data_dict_mk::install(dest_dir),
        #[cfg(feature = "bundled-data-ml")]
        "ml" => espeak_ng_data_dict_ml::install(dest_dir),
        #[cfg(feature = "bundled-data-mr")]
        "mr" => espeak_ng_data_dict_mr::install(dest_dir),
        #[cfg(feature = "bundled-data-ms")]
        "ms" => espeak_ng_data_dict_ms::install(dest_dir),
        #[cfg(feature = "bundled-data-mt")]
        "mt" => espeak_ng_data_dict_mt::install(dest_dir),
        #[cfg(feature = "bundled-data-mto")]
        "mto" => espeak_ng_data_dict_mto::install(dest_dir),
        #[cfg(feature = "bundled-data-my")]
        "my" => espeak_ng_data_dict_my::install(dest_dir),
        #[cfg(feature = "bundled-data-nci")]
        "nci" => espeak_ng_data_dict_nci::install(dest_dir),
        #[cfg(feature = "bundled-data-ne")]
        "ne" => espeak_ng_data_dict_ne::install(dest_dir),
        #[cfg(feature = "bundled-data-nl")]
        "nl" => espeak_ng_data_dict_nl::install(dest_dir),
        #[cfg(feature = "bundled-data-no")]
        "no" => espeak_ng_data_dict_no::install(dest_dir),
        #[cfg(feature = "bundled-data-nog")]
        "nog" => espeak_ng_data_dict_nog::install(dest_dir),
        #[cfg(feature = "bundled-data-om")]
        "om" => espeak_ng_data_dict_om::install(dest_dir),
        #[cfg(feature = "bundled-data-or")]
        "or" => espeak_ng_data_dict_or::install(dest_dir),
        #[cfg(feature = "bundled-data-pa")]
        "pa" => espeak_ng_data_dict_pa::install(dest_dir),
        #[cfg(feature = "bundled-data-pap")]
        "pap" => espeak_ng_data_dict_pap::install(dest_dir),
        #[cfg(feature = "bundled-data-piqd")]
        "piqd" => espeak_ng_data_dict_piqd::install(dest_dir),
        #[cfg(feature = "bundled-data-pl")]
        "pl" => espeak_ng_data_dict_pl::install(dest_dir),
        #[cfg(feature = "bundled-data-pt")]
        "pt" => espeak_ng_data_dict_pt::install(dest_dir),
        #[cfg(feature = "bundled-data-py")]
        "py" => espeak_ng_data_dict_py::install(dest_dir),
        #[cfg(feature = "bundled-data-qdb")]
        "qdb" => espeak_ng_data_dict_qdb::install(dest_dir),
        #[cfg(feature = "bundled-data-qu")]
        "qu" => espeak_ng_data_dict_qu::install(dest_dir),
        #[cfg(feature = "bundled-data-quc")]
        "quc" => espeak_ng_data_dict_quc::install(dest_dir),
        #[cfg(feature = "bundled-data-qya")]
        "qya" => espeak_ng_data_dict_qya::install(dest_dir),
        #[cfg(feature = "bundled-data-ro")]
        "ro" => espeak_ng_data_dict_ro::install(dest_dir),
        #[cfg(feature = "bundled-data-ru")]
        "ru" => espeak_ng_data_dict_ru::install(dest_dir),
        #[cfg(feature = "bundled-data-sd")]
        "sd" => espeak_ng_data_dict_sd::install(dest_dir),
        #[cfg(feature = "bundled-data-shn")]
        "shn" => espeak_ng_data_dict_shn::install(dest_dir),
        #[cfg(feature = "bundled-data-si")]
        "si" => espeak_ng_data_dict_si::install(dest_dir),
        #[cfg(feature = "bundled-data-sjn")]
        "sjn" => espeak_ng_data_dict_sjn::install(dest_dir),
        #[cfg(feature = "bundled-data-sk")]
        "sk" => espeak_ng_data_dict_sk::install(dest_dir),
        #[cfg(feature = "bundled-data-sl")]
        "sl" => espeak_ng_data_dict_sl::install(dest_dir),
        #[cfg(feature = "bundled-data-smj")]
        "smj" => espeak_ng_data_dict_smj::install(dest_dir),
        #[cfg(feature = "bundled-data-sq")]
        "sq" => espeak_ng_data_dict_sq::install(dest_dir),
        #[cfg(feature = "bundled-data-sr")]
        "sr" => espeak_ng_data_dict_sr::install(dest_dir),
        #[cfg(feature = "bundled-data-sv")]
        "sv" => espeak_ng_data_dict_sv::install(dest_dir),
        #[cfg(feature = "bundled-data-sw")]
        "sw" => espeak_ng_data_dict_sw::install(dest_dir),
        #[cfg(feature = "bundled-data-ta")]
        "ta" => espeak_ng_data_dict_ta::install(dest_dir),
        #[cfg(feature = "bundled-data-te")]
        "te" => espeak_ng_data_dict_te::install(dest_dir),
        #[cfg(feature = "bundled-data-th")]
        "th" => espeak_ng_data_dict_th::install(dest_dir),
        #[cfg(feature = "bundled-data-ti")]
        "ti" => espeak_ng_data_dict_ti::install(dest_dir),
        #[cfg(feature = "bundled-data-tk")]
        "tk" => espeak_ng_data_dict_tk::install(dest_dir),
        #[cfg(feature = "bundled-data-tn")]
        "tn" => espeak_ng_data_dict_tn::install(dest_dir),
        #[cfg(feature = "bundled-data-tr")]
        "tr" => espeak_ng_data_dict_tr::install(dest_dir),
        #[cfg(feature = "bundled-data-tt")]
        "tt" => espeak_ng_data_dict_tt::install(dest_dir),
        #[cfg(feature = "bundled-data-ug")]
        "ug" => espeak_ng_data_dict_ug::install(dest_dir),
        #[cfg(feature = "bundled-data-uk")]
        "uk" => espeak_ng_data_dict_uk::install(dest_dir),
        #[cfg(feature = "bundled-data-ur")]
        "ur" => espeak_ng_data_dict_ur::install(dest_dir),
        #[cfg(feature = "bundled-data-uz")]
        "uz" => espeak_ng_data_dict_uz::install(dest_dir),
        #[cfg(feature = "bundled-data-vi")]
        "vi" => espeak_ng_data_dict_vi::install(dest_dir),
        #[cfg(feature = "bundled-data-yue")]
        "yue" => espeak_ng_data_dict_yue::install(dest_dir),
        _ => Err(unsupported_language_error(lang)),
    }
}

#[allow(dead_code)]
#[cfg(not(any(feature = "bundled-data-af", feature = "bundled-data-am", feature = "bundled-data-an", feature = "bundled-data-ar", feature = "bundled-data-as", feature = "bundled-data-az", feature = "bundled-data-ba", feature = "bundled-data-be", feature = "bundled-data-bg", feature = "bundled-data-bn", feature = "bundled-data-bpy", feature = "bundled-data-bs", feature = "bundled-data-ca", feature = "bundled-data-chr", feature = "bundled-data-cmn", feature = "bundled-data-cs", feature = "bundled-data-cv", feature = "bundled-data-cy", feature = "bundled-data-da", feature = "bundled-data-de", feature = "bundled-data-el", feature = "bundled-data-en", feature = "bundled-data-eo", feature = "bundled-data-es", feature = "bundled-data-et", feature = "bundled-data-eu", feature = "bundled-data-fa", feature = "bundled-data-fi", feature = "bundled-data-fr", feature = "bundled-data-ga", feature = "bundled-data-gd", feature = "bundled-data-gn", feature = "bundled-data-grc", feature = "bundled-data-gu", feature = "bundled-data-hak", feature = "bundled-data-haw", feature = "bundled-data-he", feature = "bundled-data-hi", feature = "bundled-data-hr", feature = "bundled-data-ht", feature = "bundled-data-hu", feature = "bundled-data-hy", feature = "bundled-data-ia", feature = "bundled-data-id", feature = "bundled-data-io", feature = "bundled-data-is", feature = "bundled-data-it", feature = "bundled-data-ja", feature = "bundled-data-jbo", feature = "bundled-data-ka", feature = "bundled-data-kk", feature = "bundled-data-kl", feature = "bundled-data-kn", feature = "bundled-data-ko", feature = "bundled-data-kok", feature = "bundled-data-ku", feature = "bundled-data-ky", feature = "bundled-data-la", feature = "bundled-data-lb", feature = "bundled-data-lfn", feature = "bundled-data-lt", feature = "bundled-data-lv", feature = "bundled-data-mi", feature = "bundled-data-mk", feature = "bundled-data-ml", feature = "bundled-data-mr", feature = "bundled-data-ms", feature = "bundled-data-mt", feature = "bundled-data-mto", feature = "bundled-data-my", feature = "bundled-data-nci", feature = "bundled-data-ne", feature = "bundled-data-nl", feature = "bundled-data-no", feature = "bundled-data-nog", feature = "bundled-data-om", feature = "bundled-data-or", feature = "bundled-data-pa", feature = "bundled-data-pap", feature = "bundled-data-piqd", feature = "bundled-data-pl", feature = "bundled-data-pt", feature = "bundled-data-py", feature = "bundled-data-qdb", feature = "bundled-data-qu", feature = "bundled-data-quc", feature = "bundled-data-qya", feature = "bundled-data-ro", feature = "bundled-data-ru", feature = "bundled-data-sd", feature = "bundled-data-shn", feature = "bundled-data-si", feature = "bundled-data-sjn", feature = "bundled-data-sk", feature = "bundled-data-sl", feature = "bundled-data-smj", feature = "bundled-data-sq", feature = "bundled-data-sr", feature = "bundled-data-sv", feature = "bundled-data-sw", feature = "bundled-data-ta", feature = "bundled-data-te", feature = "bundled-data-th", feature = "bundled-data-ti", feature = "bundled-data-tk", feature = "bundled-data-tn", feature = "bundled-data-tr", feature = "bundled-data-tt", feature = "bundled-data-ug", feature = "bundled-data-uk", feature = "bundled-data-ur", feature = "bundled-data-uz", feature = "bundled-data-vi", feature = "bundled-data-yue")))]
fn install_selected_dictionary(_dest_dir: &Path, lang: &str) -> io::Result<()> {
    Err(unsupported_language_error(lang))
}

#[cfg(any(feature = "bundled-data-af", feature = "bundled-data-am", feature = "bundled-data-an", feature = "bundled-data-ar", feature = "bundled-data-as", feature = "bundled-data-az", feature = "bundled-data-ba", feature = "bundled-data-be", feature = "bundled-data-bg", feature = "bundled-data-bn", feature = "bundled-data-bpy", feature = "bundled-data-bs", feature = "bundled-data-ca", feature = "bundled-data-chr", feature = "bundled-data-cmn", feature = "bundled-data-cs", feature = "bundled-data-cv", feature = "bundled-data-cy", feature = "bundled-data-da", feature = "bundled-data-de", feature = "bundled-data-el", feature = "bundled-data-en", feature = "bundled-data-eo", feature = "bundled-data-es", feature = "bundled-data-et", feature = "bundled-data-eu", feature = "bundled-data-fa", feature = "bundled-data-fi", feature = "bundled-data-fr", feature = "bundled-data-ga", feature = "bundled-data-gd", feature = "bundled-data-gn", feature = "bundled-data-grc", feature = "bundled-data-gu", feature = "bundled-data-hak", feature = "bundled-data-haw", feature = "bundled-data-he", feature = "bundled-data-hi", feature = "bundled-data-hr", feature = "bundled-data-ht", feature = "bundled-data-hu", feature = "bundled-data-hy", feature = "bundled-data-ia", feature = "bundled-data-id", feature = "bundled-data-io", feature = "bundled-data-is", feature = "bundled-data-it", feature = "bundled-data-ja", feature = "bundled-data-jbo", feature = "bundled-data-ka", feature = "bundled-data-kk", feature = "bundled-data-kl", feature = "bundled-data-kn", feature = "bundled-data-ko", feature = "bundled-data-kok", feature = "bundled-data-ku", feature = "bundled-data-ky", feature = "bundled-data-la", feature = "bundled-data-lb", feature = "bundled-data-lfn", feature = "bundled-data-lt", feature = "bundled-data-lv", feature = "bundled-data-mi", feature = "bundled-data-mk", feature = "bundled-data-ml", feature = "bundled-data-mr", feature = "bundled-data-ms", feature = "bundled-data-mt", feature = "bundled-data-mto", feature = "bundled-data-my", feature = "bundled-data-nci", feature = "bundled-data-ne", feature = "bundled-data-nl", feature = "bundled-data-no", feature = "bundled-data-nog", feature = "bundled-data-om", feature = "bundled-data-or", feature = "bundled-data-pa", feature = "bundled-data-pap", feature = "bundled-data-piqd", feature = "bundled-data-pl", feature = "bundled-data-pt", feature = "bundled-data-py", feature = "bundled-data-qdb", feature = "bundled-data-qu", feature = "bundled-data-quc", feature = "bundled-data-qya", feature = "bundled-data-ro", feature = "bundled-data-ru", feature = "bundled-data-sd", feature = "bundled-data-shn", feature = "bundled-data-si", feature = "bundled-data-sjn", feature = "bundled-data-sk", feature = "bundled-data-sl", feature = "bundled-data-smj", feature = "bundled-data-sq", feature = "bundled-data-sr", feature = "bundled-data-sv", feature = "bundled-data-sw", feature = "bundled-data-ta", feature = "bundled-data-te", feature = "bundled-data-th", feature = "bundled-data-ti", feature = "bundled-data-tk", feature = "bundled-data-tn", feature = "bundled-data-tr", feature = "bundled-data-tt", feature = "bundled-data-ug", feature = "bundled-data-uk", feature = "bundled-data-ur", feature = "bundled-data-uz", feature = "bundled-data-vi", feature = "bundled-data-yue"))]
pub fn install_bundled_language(dest_dir: &Path, lang: &str) -> io::Result<()> {
    espeak_ng_data_phonemes::install(dest_dir)?;
    install_selected_dictionary(dest_dir, lang)
}

#[cfg(not(any(feature = "bundled-data-af", feature = "bundled-data-am", feature = "bundled-data-an", feature = "bundled-data-ar", feature = "bundled-data-as", feature = "bundled-data-az", feature = "bundled-data-ba", feature = "bundled-data-be", feature = "bundled-data-bg", feature = "bundled-data-bn", feature = "bundled-data-bpy", feature = "bundled-data-bs", feature = "bundled-data-ca", feature = "bundled-data-chr", feature = "bundled-data-cmn", feature = "bundled-data-cs", feature = "bundled-data-cv", feature = "bundled-data-cy", feature = "bundled-data-da", feature = "bundled-data-de", feature = "bundled-data-el", feature = "bundled-data-en", feature = "bundled-data-eo", feature = "bundled-data-es", feature = "bundled-data-et", feature = "bundled-data-eu", feature = "bundled-data-fa", feature = "bundled-data-fi", feature = "bundled-data-fr", feature = "bundled-data-ga", feature = "bundled-data-gd", feature = "bundled-data-gn", feature = "bundled-data-grc", feature = "bundled-data-gu", feature = "bundled-data-hak", feature = "bundled-data-haw", feature = "bundled-data-he", feature = "bundled-data-hi", feature = "bundled-data-hr", feature = "bundled-data-ht", feature = "bundled-data-hu", feature = "bundled-data-hy", feature = "bundled-data-ia", feature = "bundled-data-id", feature = "bundled-data-io", feature = "bundled-data-is", feature = "bundled-data-it", feature = "bundled-data-ja", feature = "bundled-data-jbo", feature = "bundled-data-ka", feature = "bundled-data-kk", feature = "bundled-data-kl", feature = "bundled-data-kn", feature = "bundled-data-ko", feature = "bundled-data-kok", feature = "bundled-data-ku", feature = "bundled-data-ky", feature = "bundled-data-la", feature = "bundled-data-lb", feature = "bundled-data-lfn", feature = "bundled-data-lt", feature = "bundled-data-lv", feature = "bundled-data-mi", feature = "bundled-data-mk", feature = "bundled-data-ml", feature = "bundled-data-mr", feature = "bundled-data-ms", feature = "bundled-data-mt", feature = "bundled-data-mto", feature = "bundled-data-my", feature = "bundled-data-nci", feature = "bundled-data-ne", feature = "bundled-data-nl", feature = "bundled-data-no", feature = "bundled-data-nog", feature = "bundled-data-om", feature = "bundled-data-or", feature = "bundled-data-pa", feature = "bundled-data-pap", feature = "bundled-data-piqd", feature = "bundled-data-pl", feature = "bundled-data-pt", feature = "bundled-data-py", feature = "bundled-data-qdb", feature = "bundled-data-qu", feature = "bundled-data-quc", feature = "bundled-data-qya", feature = "bundled-data-ro", feature = "bundled-data-ru", feature = "bundled-data-sd", feature = "bundled-data-shn", feature = "bundled-data-si", feature = "bundled-data-sjn", feature = "bundled-data-sk", feature = "bundled-data-sl", feature = "bundled-data-smj", feature = "bundled-data-sq", feature = "bundled-data-sr", feature = "bundled-data-sv", feature = "bundled-data-sw", feature = "bundled-data-ta", feature = "bundled-data-te", feature = "bundled-data-th", feature = "bundled-data-ti", feature = "bundled-data-tk", feature = "bundled-data-tn", feature = "bundled-data-tr", feature = "bundled-data-tt", feature = "bundled-data-ug", feature = "bundled-data-uk", feature = "bundled-data-ur", feature = "bundled-data-uz", feature = "bundled-data-vi", feature = "bundled-data-yue")))]
pub fn install_bundled_language(_dest_dir: &Path, lang: &str) -> io::Result<()> {
    Err(unsupported_language_error(lang))
}

#[cfg(any(feature = "bundled-data-af", feature = "bundled-data-am", feature = "bundled-data-an", feature = "bundled-data-ar", feature = "bundled-data-as", feature = "bundled-data-az", feature = "bundled-data-ba", feature = "bundled-data-be", feature = "bundled-data-bg", feature = "bundled-data-bn", feature = "bundled-data-bpy", feature = "bundled-data-bs", feature = "bundled-data-ca", feature = "bundled-data-chr", feature = "bundled-data-cmn", feature = "bundled-data-cs", feature = "bundled-data-cv", feature = "bundled-data-cy", feature = "bundled-data-da", feature = "bundled-data-de", feature = "bundled-data-el", feature = "bundled-data-en", feature = "bundled-data-eo", feature = "bundled-data-es", feature = "bundled-data-et", feature = "bundled-data-eu", feature = "bundled-data-fa", feature = "bundled-data-fi", feature = "bundled-data-fr", feature = "bundled-data-ga", feature = "bundled-data-gd", feature = "bundled-data-gn", feature = "bundled-data-grc", feature = "bundled-data-gu", feature = "bundled-data-hak", feature = "bundled-data-haw", feature = "bundled-data-he", feature = "bundled-data-hi", feature = "bundled-data-hr", feature = "bundled-data-ht", feature = "bundled-data-hu", feature = "bundled-data-hy", feature = "bundled-data-ia", feature = "bundled-data-id", feature = "bundled-data-io", feature = "bundled-data-is", feature = "bundled-data-it", feature = "bundled-data-ja", feature = "bundled-data-jbo", feature = "bundled-data-ka", feature = "bundled-data-kk", feature = "bundled-data-kl", feature = "bundled-data-kn", feature = "bundled-data-ko", feature = "bundled-data-kok", feature = "bundled-data-ku", feature = "bundled-data-ky", feature = "bundled-data-la", feature = "bundled-data-lb", feature = "bundled-data-lfn", feature = "bundled-data-lt", feature = "bundled-data-lv", feature = "bundled-data-mi", feature = "bundled-data-mk", feature = "bundled-data-ml", feature = "bundled-data-mr", feature = "bundled-data-ms", feature = "bundled-data-mt", feature = "bundled-data-mto", feature = "bundled-data-my", feature = "bundled-data-nci", feature = "bundled-data-ne", feature = "bundled-data-nl", feature = "bundled-data-no", feature = "bundled-data-nog", feature = "bundled-data-om", feature = "bundled-data-or", feature = "bundled-data-pa", feature = "bundled-data-pap", feature = "bundled-data-piqd", feature = "bundled-data-pl", feature = "bundled-data-pt", feature = "bundled-data-py", feature = "bundled-data-qdb", feature = "bundled-data-qu", feature = "bundled-data-quc", feature = "bundled-data-qya", feature = "bundled-data-ro", feature = "bundled-data-ru", feature = "bundled-data-sd", feature = "bundled-data-shn", feature = "bundled-data-si", feature = "bundled-data-sjn", feature = "bundled-data-sk", feature = "bundled-data-sl", feature = "bundled-data-smj", feature = "bundled-data-sq", feature = "bundled-data-sr", feature = "bundled-data-sv", feature = "bundled-data-sw", feature = "bundled-data-ta", feature = "bundled-data-te", feature = "bundled-data-th", feature = "bundled-data-ti", feature = "bundled-data-tk", feature = "bundled-data-tn", feature = "bundled-data-tr", feature = "bundled-data-tt", feature = "bundled-data-ug", feature = "bundled-data-uk", feature = "bundled-data-ur", feature = "bundled-data-uz", feature = "bundled-data-vi", feature = "bundled-data-yue"))]
pub fn install_bundled_languages(dest_dir: &Path, languages: &[&str]) -> io::Result<()> {
    espeak_ng_data_phonemes::install(dest_dir)?;
    for &lang in languages {
        install_selected_dictionary(dest_dir, lang)?;
    }
    Ok(())
}

#[cfg(not(any(feature = "bundled-data-af", feature = "bundled-data-am", feature = "bundled-data-an", feature = "bundled-data-ar", feature = "bundled-data-as", feature = "bundled-data-az", feature = "bundled-data-ba", feature = "bundled-data-be", feature = "bundled-data-bg", feature = "bundled-data-bn", feature = "bundled-data-bpy", feature = "bundled-data-bs", feature = "bundled-data-ca", feature = "bundled-data-chr", feature = "bundled-data-cmn", feature = "bundled-data-cs", feature = "bundled-data-cv", feature = "bundled-data-cy", feature = "bundled-data-da", feature = "bundled-data-de", feature = "bundled-data-el", feature = "bundled-data-en", feature = "bundled-data-eo", feature = "bundled-data-es", feature = "bundled-data-et", feature = "bundled-data-eu", feature = "bundled-data-fa", feature = "bundled-data-fi", feature = "bundled-data-fr", feature = "bundled-data-ga", feature = "bundled-data-gd", feature = "bundled-data-gn", feature = "bundled-data-grc", feature = "bundled-data-gu", feature = "bundled-data-hak", feature = "bundled-data-haw", feature = "bundled-data-he", feature = "bundled-data-hi", feature = "bundled-data-hr", feature = "bundled-data-ht", feature = "bundled-data-hu", feature = "bundled-data-hy", feature = "bundled-data-ia", feature = "bundled-data-id", feature = "bundled-data-io", feature = "bundled-data-is", feature = "bundled-data-it", feature = "bundled-data-ja", feature = "bundled-data-jbo", feature = "bundled-data-ka", feature = "bundled-data-kk", feature = "bundled-data-kl", feature = "bundled-data-kn", feature = "bundled-data-ko", feature = "bundled-data-kok", feature = "bundled-data-ku", feature = "bundled-data-ky", feature = "bundled-data-la", feature = "bundled-data-lb", feature = "bundled-data-lfn", feature = "bundled-data-lt", feature = "bundled-data-lv", feature = "bundled-data-mi", feature = "bundled-data-mk", feature = "bundled-data-ml", feature = "bundled-data-mr", feature = "bundled-data-ms", feature = "bundled-data-mt", feature = "bundled-data-mto", feature = "bundled-data-my", feature = "bundled-data-nci", feature = "bundled-data-ne", feature = "bundled-data-nl", feature = "bundled-data-no", feature = "bundled-data-nog", feature = "bundled-data-om", feature = "bundled-data-or", feature = "bundled-data-pa", feature = "bundled-data-pap", feature = "bundled-data-piqd", feature = "bundled-data-pl", feature = "bundled-data-pt", feature = "bundled-data-py", feature = "bundled-data-qdb", feature = "bundled-data-qu", feature = "bundled-data-quc", feature = "bundled-data-qya", feature = "bundled-data-ro", feature = "bundled-data-ru", feature = "bundled-data-sd", feature = "bundled-data-shn", feature = "bundled-data-si", feature = "bundled-data-sjn", feature = "bundled-data-sk", feature = "bundled-data-sl", feature = "bundled-data-smj", feature = "bundled-data-sq", feature = "bundled-data-sr", feature = "bundled-data-sv", feature = "bundled-data-sw", feature = "bundled-data-ta", feature = "bundled-data-te", feature = "bundled-data-th", feature = "bundled-data-ti", feature = "bundled-data-tk", feature = "bundled-data-tn", feature = "bundled-data-tr", feature = "bundled-data-tt", feature = "bundled-data-ug", feature = "bundled-data-uk", feature = "bundled-data-ur", feature = "bundled-data-uz", feature = "bundled-data-vi", feature = "bundled-data-yue")))]
pub fn install_bundled_languages(_dest_dir: &Path, languages: &[&str]) -> io::Result<()> {
    if let Some(lang) = languages.first() {
        Err(unsupported_language_error(lang))
    } else {
        Ok(())
    }
}