From fbe9539748fda97161ffa36337a1f10c93e36e03 Mon Sep 17 00:00:00 2001 From: jonsd Date: Thu, 14 Mar 2013 00:34:12 +0000 Subject: [PATCH] [1.46.49] Fix: character names sometimes not spoken correctly if they are from another language's dictionary. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@315 d46cf337-b52f-0410-862d-fd96e6ae7743 --- src/phonemelist.cpp | 9 ++++++--- src/readclause.cpp | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/phonemelist.cpp b/src/phonemelist.cpp index 1e39610f..a0c3f9d4 100644 --- a/src/phonemelist.cpp +++ b/src/phonemelist.cpp @@ -341,10 +341,13 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence) ph = phoneme_tab[plist3->phcode]; plist3[0].ph = ph; - if((plist3->phcode == phonSWITCH) && !(plist3->synthflags & SFLAG_EMBEDDED)) // ?? phonSWITCH can't have SFLAG_EMBEDDED ?? + if(plist3->phcode == phonSWITCH) { - if((plist3[1].phcode == phonSWITCH) || ((plist3[1].type == phPAUSE) && (plist3[2].phcode == phonSWITCH))) - continue; // next phoneme is also a phonSWITCH, so ignore + if(!(plist3->synthflags & SFLAG_EMBEDDED)) // ?? phonSWITCH can't have SFLAG_EMBEDDED ?? + { + if((plist3[1].phcode == phonSWITCH) || ((plist3[1].type == phPAUSE) && (plist3[2].phcode == phonSWITCH))) + continue; // next phoneme is also a phonSWITCH, so ignore + } // change phoneme table SelectPhonemeTable(plist3->tone_ph); diff --git a/src/readclause.cpp b/src/readclause.cpp index 785356ed..b701d854 100644 --- a/src/readclause.cpp +++ b/src/readclause.cpp @@ -643,7 +643,7 @@ static const char *LookupCharName(Translator *tr, int c, int only) } } - if((only==0) && (phonemes[0] == 0) && (tr->translator_name != L('e','n'))) + if((only==0) && ((phonemes[0] == 0) || (phonemes[0] == phonSWITCH)) && (tr->translator_name != L('e','n'))) { // not found, try English SetTranslator2("en");