From 6a43f8c9849da6dd2a8b20fc2acc927b7a75ddf4 Mon Sep 17 00:00:00 2001 From: Juho Hiltunen Date: Thu, 4 Mar 2021 19:45:22 +0200 Subject: [PATCH] code cleanup: remove dead code for Divehi (dv) The language is not supported and apparently never has been. --- Makefile.am | 1 - phsource/ph_divehi | 95 --------------------------------- phsource/phonemes | 3 -- src/libespeak-ng/tr_languages.c | 15 ------ src/libespeak-ng/translate.c | 3 -- 5 files changed, 117 deletions(-) delete mode 100644 phsource/ph_divehi diff --git a/Makefile.am b/Makefile.am index e41a2e20..357a773e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -337,7 +337,6 @@ phsource/phonemes.stamp: \ phsource/ph_czech \ phsource/ph_danish \ phsource/ph_dari \ - phsource/ph_divehi \ phsource/ph_dutch \ phsource/ph_english \ phsource/ph_english_n \ diff --git a/phsource/ph_divehi b/phsource/ph_divehi deleted file mode 100644 index 12f2c40b..00000000 --- a/phsource/ph_divehi +++ /dev/null @@ -1,95 +0,0 @@ - -// Phonemes for Divehi -// This inherits from ph_hindi - - - -phoneme a - vwl starttype #a endtype #a - length 130 - ChangeIfDiminished(V) // ?? final syllable of word - FMT(vowel/a#) -endphoneme - - -phoneme a: - vwl starttype #a endtype #a - length 300 - FMT(vowel/a#) -endphoneme - - -phoneme e - vwl starttype #e endtype #e - length 130 - FMT(vowel/e) -endphoneme - - -phoneme e: - vwl starttype #e endtype #e - length 250 - FMT(vowel/e) -endphoneme - - -phoneme i - vwl starttype #i endtype #i - length 130 - FMT(vowel/i_6) -endphoneme - - -phoneme i: - vwl starttype #i endtype #i - length 270 - FMT(vowel/i) -endphoneme - - - -phoneme o - vwl starttype #o endtype #o - length 130 - FMT(vowel/o_mid) -endphoneme - - -phoneme o: - vwl starttype #o endtype #o - length 300 - FMT(vowel/o_mid) -endphoneme - - -phoneme u - vwl starttype #u endtype #u - length 110 - FMT(vowel/u_6) -endphoneme - - -phoneme u: - vwl starttype #u endtype #u - length 290 - FMT(vowel/u_6) -endphoneme - - -phoneme aI - vwl starttype #a endtype #i - length 280 - FMT(vdiph/ai_8) -endphoneme - - - -phoneme t - import_phoneme base2/t // dental -endphoneme - -// ?? This is standard [v]. Should be it [v] without the fricative noise? -phoneme v - import_phoneme base1/v -endphoneme - diff --git a/phsource/phonemes b/phsource/phonemes index ee7a7fc7..3c698f73 100644 --- a/phsource/phonemes +++ b/phsource/phonemes @@ -1968,9 +1968,6 @@ include ph_marathi phonemetable kok hi_base include ph_konkani -phonemetable dv hi_base -include ph_divehi - phonemetable te hi_base include ph_telugu diff --git a/src/libespeak-ng/tr_languages.c b/src/libespeak-ng/tr_languages.c index 7ed230b1..6bda0293 100644 --- a/src/libespeak-ng/tr_languages.c +++ b/src/libespeak-ng/tr_languages.c @@ -39,7 +39,6 @@ #define OFFSET_HEBREW 0x590 #define OFFSET_ARABIC 0x600 #define OFFSET_SYRIAC 0x700 -#define OFFSET_THAANA 0x780 // Divehi/Maldives #define OFFSET_DEVANAGARI 0x900 #define OFFSET_BENGALI 0x980 #define OFFSET_GURMUKHI 0xa00 @@ -66,7 +65,6 @@ ALPHABET alphabets[] = { { "_he", OFFSET_HEBREW, 0x590, 0x5ff, 0, 0 }, { "_ar", OFFSET_ARABIC, 0x600, 0x6ff, 0, 0 }, { "_syc", OFFSET_SYRIAC, 0x700, 0x74f, 0, 0 }, - { "_dv", OFFSET_THAANA, 0x780, 0x7bf, 0, 0 }, { "_hi", OFFSET_DEVANAGARI, 0x900, 0x97f, L('h', 'i'), AL_WORDS }, { "_bn", OFFSET_BENGALI, 0x0980, 0x9ff, L('b', 'n'), AL_WORDS }, { "_gur", OFFSET_GURMUKHI, 0xa00, 0xa7f, L('p', 'a'), AL_WORDS }, @@ -623,19 +621,6 @@ Translator *SelectTranslator(const char *name) tr->langopts.param[LOPT_UNPRONOUNCABLE] = 2; // use de_rules for unpronouncable rules } break; - case L('d', 'v'): // Divehi (Maldives) FIXME: this language code is actually never used - { - SetupTranslator(tr, stress_lengths_ta, stress_amps_ta); - tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words - tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable - tr->letter_bits_offset = OFFSET_THAANA; - tr->langopts.stress_rule = STRESSPOSN_1L; - tr->langopts.stress_flags = S_MID_DIM | S_FINAL_DIM; // use 'diminished' for unstressed final syllable - SetLetterBitsRange(tr, LETTERGP_B, 0x26, 0x30); // vowel signs, and virama - tr->langopts.break_numbers = BREAK_LAKH_DV; - tr->langopts.numbers = NUM_DEFAULT; - } - break; case L('e', 'n'): { static const short stress_lengths_en[8] = { 182, 140, 220, 220, 0, 0, 248, 275 }; diff --git a/src/libespeak-ng/translate.c b/src/libespeak-ng/translate.c index d4f032e3..dd55898d 100644 --- a/src/libespeak-ng/translate.c +++ b/src/libespeak-ng/translate.c @@ -221,9 +221,6 @@ int IsAlpha(unsigned int c) if ((c >= 0x300) && (c <= 0x36f)) return 1; // combining accents - if ((c >= 0x780) && (c <= 0x7b1)) - return 1; // taani/divehi (maldives) - if ((c >= 0xf40) && (c <= 0xfbc)) return 1; // tibetan