diff --git a/src/libespeak-ng/dictionary.c b/src/libespeak-ng/dictionary.c index 1b43acea..6ee34fb2 100644 --- a/src/libespeak-ng/dictionary.c +++ b/src/libespeak-ng/dictionary.c @@ -1373,6 +1373,19 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, if ((stress == 3) && (stressflags & S_NO_AUTO_2)) continue; // don't use secondary stress + // don't put secondary stress on a light syllable if the rest of the word (excluding last syllable) contains a heavy syllable + if ((v > 1) && (stressflags & S_2_TO_HEAVY) && (syllable_weight[v] == 0)) { + bool skip = false; + for (int i = v; i < vowel_count - 1; i++) { + if (syllable_weight[i] > 0) { + skip = true; + break; + } + } + if (skip == true) + continue; + } + if ((v > 1) && (stressflags & S_2_TO_HEAVY) && (syllable_weight[v] == 0) && (syllable_weight[v+1] > 0)) { // don't put secondary stress on a light syllable which is followed by a heavy syllable continue;