From 4519d2a8e4157f2ee11d3d8bd5d0ae1384ac941b Mon Sep 17 00:00:00 2001 From: "Chen, Chien-ting" Date: Wed, 3 Jan 2018 22:59:07 +0800 Subject: [PATCH] add hakka sandhi and footnotes --- src/libespeak-ng/intonation.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libespeak-ng/intonation.c b/src/libespeak-ng/intonation.c index afd296aa..60d541a2 100644 --- a/src/libespeak-ng/intonation.c +++ b/src/libespeak-ng/intonation.c @@ -844,13 +844,17 @@ static void CalcPitches_Tone(Translator *tr) if (p->synthflags & SFLAG_SYLLABLE) { tone_ph = p->tone_ph; tph = phoneme_tab[tone_ph]; - // Hakka + + /* Hakka + ref.:https://en.wikipedia.org/wiki/Sixian_dialect#Tone_sandhi */ if (tr->translator_name == L3('h','a','k')){ if (prev_tph->mnemonic == 0x31){ // [previous one is 1st tone] // [this one is 1st, 4th, or 6th tone] if (tph->mnemonic == 0x31 || tph->mnemonic == 0x34 || tph->mnemonic == 0x36){ - prev_p->tone_ph = PhonemeCode('2'); + /* trigger the tone sandhi of the prev. syllable + from 1st tone ->2nd tone */ + prev_p->tone_ph = PhonemeCode('2'); } } }