From bf3bb39fb0b564b7b75a317585ce848ce4a11418 Mon Sep 17 00:00:00 2001 From: Valdis Vitolins Date: Wed, 30 May 2018 23:53:41 +0300 Subject: [PATCH] Implementation for feature #489 When .replace rule is used and -X switch is passed in runtime, replaced characters should be shown in trace output. --- src/libespeak-ng/translate.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/libespeak-ng/translate.c b/src/libespeak-ng/translate.c index d24165b1..db2f2836 100644 --- a/src/libespeak-ng/translate.c +++ b/src/libespeak-ng/translate.c @@ -1845,6 +1845,19 @@ static int SubstituteChar(Translator *tr, unsigned int c, unsigned int next_in, new_c = ucd_toupper(new_c); *wordflags |= FLAG_CHAR_REPLACED; + if (option_phonemes & espeakPHONEMES_TRACE) { + char msg[21] = {'R','e','p','l','a','c','e',':',' '}; + char *index = &msg; + index +=9; + index += utf8_out(c, index); + *index++ = ' '; + *index++ = '>'; + *index++ = ' '; + index += utf8_out(new_c, index); + index += utf8_out(c2, index); + *index = 0; + fprintf(f_trans, "%s\n", msg); + } return new_c; }