When printing phonemes, don't add a space at the start of a sentence or clause.

This commit is contained in:
Reece H. Dunn
2018-08-19 13:11:18 +01:00
parent 65186c07df
commit c6ac526847
9 changed files with 146 additions and 136 deletions
+1 -1
View File
@@ -578,7 +578,7 @@ const char *GetTranslatedPhonemeString(int phoneme_mode)
plist = &phoneme_list[ix];
WritePhMnemonic(phon_buf2, plist->ph, plist, use_ipa, &flags);
if (plist->newword)
if (plist->newword & PHLIST_START_OF_WORD && !(plist->newword & (PHLIST_START_OF_SENTENCE | PHLIST_START_OF_CLAUSE)))
*buf++ = ' ';
if ((!plist->newword) || (separate_phonemes == ' ')) {
+7
View File
@@ -128,6 +128,7 @@ void MakePhonemeList(Translator *tr, int post_pause, bool start_sentence, int *n
bool inserted;
bool deleted;
PHONEME_DATA phdata;
bool start_of_clause = true;
int n_ph_list3;
PHONEME_LIST *plist3;
@@ -517,6 +518,11 @@ void MakePhonemeList(Translator *tr, int post_pause, bool start_sentence, int *n
phlist[ix].newword |= PHLIST_START_OF_SENTENCE;
start_sentence = false;
}
if (start_of_clause) {
phlist[ix].newword |= PHLIST_START_OF_CLAUSE;
start_of_clause = false;
}
} else
phlist[ix].newword = 0;
@@ -538,6 +544,7 @@ void MakePhonemeList(Translator *tr, int post_pause, bool start_sentence, int *n
ix++;
}
}
phlist[ix].newword = PHLIST_END_OF_CLAUSE;
phlist[ix].phcode = phonPAUSE;
+1
View File
@@ -190,6 +190,7 @@ typedef struct {
#define PHLIST_START_OF_WORD 1
#define PHLIST_END_OF_CLAUSE 2
#define PHLIST_START_OF_SENTENCE 4
#define PHLIST_START_OF_CLAUSE 8
typedef struct {
// The first section is a copy of PHONEME_LIST2