Unify terminology for stress

synthesize.h now contains the definitions STRESS_IS_... that should be used with code related to syllable stress.

Note that isBreak and other defines were renumbered so that stress definitions could have values 0-6.

Possible TODOs:
1. Unify with terms used with phonemes, i.e. keywords like isDiminished in compiledata.c and stress_type in phsource/phonemes
2. Add functionality and documentation about STRESS_IS_PRIORITY and STRESS_IS_EMPHASIZED
This commit is contained in:
Juho Hiltunen
2018-01-14 15:26:03 +02:00
parent 88315250ff
commit da287fb851
4 changed files with 136 additions and 131 deletions
+9 -9
View File
@@ -466,15 +466,15 @@ static bool StressCondition(Translator *tr, PHONEME_LIST *plist, int condition,
if ((tr->langopts.param[LOPT_REDUCE] & 0x2) && (stress_level >= pl->wordstress)) {
// treat the most stressed syllable in an unstressed word as stressed
stress_level = 4;
stress_level = STRESS_IS_PRIMARY;
}
}
if (condition == isMaxStress)
if (condition == STRESS_IS_PRIMARY)
return stress_level >= pl->wordstress;
if (condition == isStressed) {
if (stress_level > 3)
if (condition == STRESS_IS_SECONDARY) {
if (stress_level > STRESS_IS_SECONDARY)
return true;
} else {
if (stress_level < condition_level[condition])
@@ -633,11 +633,11 @@ static bool InterpretCondition(Translator *tr, int control, PHONEME_LIST *plist,
case CONDITION_IS_OTHER:
switch (data)
{
case isDiminished:
case isUnstressed:
case isNotStressed:
case isStressed:
case isMaxStress:
case STRESS_IS_DIMINISHED:
case STRESS_IS_UNSTRESSED:
case STRESS_IS_NOT_STRESSED:
case STRESS_IS_SECONDARY:
case STRESS_IS_PRIMARY:
return StressCondition(tr, plist, data, 0);
case isBreak:
return (ph->type == phPAUSE) || (plist_this->synthflags & SFLAG_NEXT_PAUSE);