diff --git a/src/libespeak-ng/readclause.c b/src/libespeak-ng/readclause.c index fe537908..1e02b6d1 100644 --- a/src/libespeak-ng/readclause.c +++ b/src/libespeak-ng/readclause.c @@ -1071,8 +1071,15 @@ int ReadClause(Translator *tr, char *buf, short *charix, int *charix_top, int n_ is_end_clause = false; // Roman number followed by dot else if (iswlower(c_next) || (c_next == '-')) // hyphen is needed for lang-hu (eg. 2.-kal) is_end_clause = false; // only if followed by lower-case, (or if there is a XML tag) - } else if (c_next == '\'') - is_end_clause = false; // eg. u.s.a.'s + } else if (c_next == '\'') { + // A special case to handle english acronym + genitive + // eg. u.s.a.'s + // But avoid breaking clause handling if anything else follows the apostrophe. + c_next = GetC(); + if(c_next == 's') + is_end_clause = false; + UngetC(c_next); + } if (iswlower(c_next)) { // next word has no capital letter, this dot is probably from an abbreviation is_end_clause = 0; diff --git a/tests/translate.test b/tests/translate.test index 75a93978..fbcca3c0 100755 --- a/tests/translate.test +++ b/tests/translate.test @@ -55,6 +55,15 @@ d'i: 'i: 'Ef" "A. B C, D. E: F." +# Handling of english acronym + genitive without breaking simple quote +test_phonemes en "hi: s'Ed +aI w0z b'O@n InD@ j,u:,Es'eI z_:_: and l'Eft" "He said : I was born in the u.s.a.'s and left." + +test_phonemes en "hi: s'Ed +h@l'oU +aIa#m b'ak +and l'Eft" "He said : 'Hello, I am back.' and left." + #----- Emoji [http://www.unicode.org/reports/tr51/tr51-12.html] ----- # ED-3 - emoji_character