static bool StressCondition(Translator *tr, PHONEME_LIST *plist, int condition, int control) | static bool StressCondition(Translator *tr, PHONEME_LIST *plist, int condition, int control) | ||||
{ | { | ||||
// condition: | |||||
// 0 if diminished, 1 if unstressed, 2 if not stressed, 3 if stressed, 4 if max stress | |||||
int stress_level; | int stress_level; | ||||
PHONEME_LIST *pl; | PHONEME_LIST *pl; | ||||
static int condition_level[4] = { 1, 2, 4, 15 }; | static int condition_level[4] = { 1, 2, 4, 15 }; | ||||
} | } | ||||
} | } | ||||
if (condition == 4) | |||||
if (condition == isMaxStress) | |||||
return stress_level >= pl->wordstress; | return stress_level >= pl->wordstress; | ||||
if (condition == 3) { | |||||
// if stressed | |||||
if (condition == isStressed) { | |||||
if (stress_level > 3) | if (stress_level > 3) | ||||
return true; | return true; | ||||
} else { | } else { |
#define CONDITION_IS_PHFLAG_SET 0x40 | #define CONDITION_IS_PHFLAG_SET 0x40 | ||||
#define CONDITION_IS_OTHER 0x80 | #define CONDITION_IS_OTHER 0x80 | ||||
// other conditions | |||||
// other conditions (stress) | |||||
#define isDiminished 0 | #define isDiminished 0 | ||||
#define isUnstressed 1 | #define isUnstressed 1 | ||||
#define isNotStressed 2 | #define isNotStressed 2 | ||||
#define isStressed 3 | #define isStressed 3 | ||||
#define isMaxStress 4 | #define isMaxStress 4 | ||||
// other conditions | |||||
#define isBreak 5 // pause phoneme or (stop/vstop/vfric not followed by vowel or (liquid in same word)) | #define isBreak 5 // pause phoneme or (stop/vstop/vfric not followed by vowel or (liquid in same word)) | ||||
#define isWordStart 6 | #define isWordStart 6 | ||||
#define isWordEnd 8 | #define isWordEnd 8 |