mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
Merge branch 'spellingStress'
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
- [dictrules](#dictrules)
|
||||
- [lowercaseSentence](#lowercaseSentence)
|
||||
- [replace](#replace)
|
||||
- [spellingStress](#spellingStress)
|
||||
- [stressOpt](#stressopt)
|
||||
- [stressRule](#stressrule)
|
||||
- [stressLength](#stresslength)
|
||||
@@ -418,6 +419,12 @@ e.g.
|
||||
The phoneme mnemonics can be defined for each language, but some are
|
||||
listed in [Phonemes](phonemes.md).
|
||||
|
||||
### spellingStress
|
||||
|
||||
spellingStress
|
||||
|
||||
When set, stress first letter when reading abbreviations.
|
||||
|
||||
### stressOpt
|
||||
|
||||
stressOpt <list of rule numbers>
|
||||
|
||||
@@ -7,3 +7,4 @@ stressOpt 1 2 4 6 // (S_NO_DIM + S_FINAL_DIM = S_FINAL_DIM_ONLY), S_FINAL_NO_2,
|
||||
stressRule 0
|
||||
|
||||
intonation 3
|
||||
spellingStress
|
||||
|
||||
@@ -7,4 +7,5 @@ stressLength 150 180 200 200 0 0 210 250
|
||||
stressOpt 1 2 4 6 // (S_NO_DIM + S_FINAL_DIM = S_FINAL_DIM_ONLY), S_FINAL_NO_2, S_2_TO_HEAVY
|
||||
stressRule 0
|
||||
|
||||
intonation 3
|
||||
intonation 3
|
||||
spellingStress
|
||||
|
||||
@@ -95,6 +95,10 @@ if (CheckTranslator(translator, langopts_tab, key) != 0) {
|
||||
translator->langopts.lowercase_sentence = true;
|
||||
break;
|
||||
}
|
||||
case V_SPELLINGSTRESS: {
|
||||
translator->langopts.spelling_stress = true;
|
||||
break;
|
||||
}
|
||||
case V_STRESSADD: { // stressAdd
|
||||
int stress_add_set = 0;
|
||||
int stress_add[8];
|
||||
|
||||
@@ -657,7 +657,7 @@ void SetSpellingStress(Translator *tr, char *phonemes, int control, int n_chars)
|
||||
if ((c == phonSTRESS_P) && (n_chars > 1) && (prev != phonSWITCH)) {
|
||||
count++;
|
||||
|
||||
if (tr->langopts.spelling_stress == 1) {
|
||||
if (tr->langopts.spelling_stress) {
|
||||
// stress on initial letter when spelling
|
||||
if (count > 1)
|
||||
c = phonSTRESS_3;
|
||||
|
||||
@@ -302,6 +302,7 @@ static Translator *NewTranslator(void)
|
||||
tr->langopts.param[LOPT_UNPRONOUNCABLE] = 's'; // don't count this character at start of word
|
||||
tr->langopts.param[LOPT_BRACKET_PAUSE] = 4; // pause at bracket
|
||||
tr->langopts.param[LOPT_BRACKET_PAUSE_ANNOUNCED] = 2; // pauses when announcing bracket names
|
||||
tr->langopts.spelling_stress = false;
|
||||
tr->langopts.max_initial_consonants = 3;
|
||||
tr->langopts.replace_chars = NULL;
|
||||
tr->langopts.alt_alphabet_lang = L('e', 'n');
|
||||
@@ -803,7 +804,6 @@ Translator *SelectTranslator(const char *name)
|
||||
|
||||
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_DFRACTION_2 | NUM_ORDINAL_DOT;
|
||||
SetLetterVowel(tr, 'y');
|
||||
tr->langopts.spelling_stress = 1;
|
||||
}
|
||||
break;
|
||||
case L('f', 'r'): // french
|
||||
@@ -900,7 +900,7 @@ Translator *SelectTranslator(const char *name)
|
||||
tr->langopts.stress_flags = S_FINAL_NO_2;
|
||||
tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x3;
|
||||
tr->langopts.max_initial_consonants = 5;
|
||||
tr->langopts.spelling_stress = 1;
|
||||
tr->langopts.spelling_stress = true;
|
||||
tr->langopts.accents = 1;
|
||||
|
||||
tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_DECIMAL_COMMA | NUM_THOUS_SPACE | NUM_DFRACTION_2 | NUM_ROMAN_CAPITALS;
|
||||
@@ -936,7 +936,7 @@ Translator *SelectTranslator(const char *name)
|
||||
tr->langopts.max_roman = 899;
|
||||
tr->langopts.min_roman = 1;
|
||||
SetLetterVowel(tr, 'y');
|
||||
tr->langopts.spelling_stress = 1;
|
||||
tr->langopts.spelling_stress = true;
|
||||
SetLengthMods(tr, 3); // all equal
|
||||
}
|
||||
break;
|
||||
@@ -1180,7 +1180,7 @@ Translator *SelectTranslator(const char *name)
|
||||
SetupTranslator(tr, stress_lengths_lv, stress_amps_lv);
|
||||
|
||||
tr->langopts.stress_rule = STRESSPOSN_1L;
|
||||
tr->langopts.spelling_stress = 1;
|
||||
tr->langopts.spelling_stress = true;
|
||||
tr->encoding = ESPEAKNG_ENCODING_ISO_8859_4;
|
||||
tr->langopts.max_digits = 33;
|
||||
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_4 | NUM_ORDINAL_DOT;
|
||||
@@ -1322,7 +1322,7 @@ Translator *SelectTranslator(const char *name)
|
||||
tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2;
|
||||
tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x3;
|
||||
tr->langopts.max_initial_consonants = 5;
|
||||
tr->langopts.spelling_stress = 1;
|
||||
tr->langopts.spelling_stress = true;
|
||||
tr->langopts.param[LOPT_COMBINE_WORDS] = 4; // combine some prepositions with the following word
|
||||
|
||||
tr->langopts.numbers = NUM_OMIT_1_HUNDRED | NUM_DFRACTION_2 | NUM_ROMAN;
|
||||
@@ -1346,7 +1346,7 @@ Translator *SelectTranslator(const char *name)
|
||||
|
||||
tr->langopts.stress_rule = STRESSPOSN_1L;
|
||||
tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2;
|
||||
tr->langopts.spelling_stress = 1;
|
||||
tr->langopts.spelling_stress = true;
|
||||
|
||||
tr->letter_bits_offset = OFFSET_SINHALA;
|
||||
memset(tr->letter_bits, 0, sizeof(tr->letter_bits));
|
||||
@@ -1391,7 +1391,7 @@ Translator *SelectTranslator(const char *name)
|
||||
|
||||
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_SWAP_TENS | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_2 | NUM_ORDINAL_DOT;
|
||||
SetLetterVowel(tr, 'y');
|
||||
tr->langopts.spelling_stress = 1;
|
||||
tr->langopts.spelling_stress = true;
|
||||
tr->langopts.intonation_group = 3; // less intonation, don't raise pitch at comma
|
||||
}
|
||||
break;
|
||||
@@ -1450,7 +1450,7 @@ Translator *SelectTranslator(const char *name)
|
||||
|
||||
tr->langopts.stress_rule = STRESSPOSN_1L;
|
||||
tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2; // use 'diminished' for unstressed final syllable
|
||||
tr->langopts.spelling_stress = 1;
|
||||
tr->langopts.spelling_stress = true;
|
||||
tr->langopts.break_numbers = BREAK_LAKH_DV;
|
||||
|
||||
if (name2 == L('t', 'a')) {
|
||||
|
||||
@@ -525,7 +525,7 @@ typedef struct {
|
||||
unsigned char tunes[6];
|
||||
int long_stop; // extra mS pause for a lengthened stop
|
||||
char max_initial_consonants;
|
||||
char spelling_stress; // 0=default, 1=stress first letter
|
||||
bool spelling_stress;
|
||||
char tone_numbers;
|
||||
char ideographs; // treat as separate words
|
||||
bool textmode; // the meaning of FLAG_TEXTMODE is reversed (to save data when *_list file is compiled)
|
||||
|
||||
@@ -112,6 +112,7 @@ typedef enum {
|
||||
V_WORDGAP,
|
||||
V_INTONATION,
|
||||
V_TUNES,
|
||||
V_SPELLINGSTRESS,
|
||||
V_STRESSLENGTH,
|
||||
V_STRESSAMP,
|
||||
V_STRESSADD,
|
||||
@@ -145,6 +146,7 @@ static const MNEM_TAB langopts_tab[] = {
|
||||
{ "l_sonorant_min", 0x100+LOPT_SONORANT_MIN },
|
||||
{ "lowercaseSentence", V_LOWERCASE_SENTENCE },
|
||||
{ "numbers", V_NUMBERS },
|
||||
{ "spellingStress", V_SPELLINGSTRESS },
|
||||
{ "stressAdd", V_STRESSADD },
|
||||
{ "stressAmp", V_STRESSAMP },
|
||||
{ "stressLength", V_STRESSLENGTH },
|
||||
|
||||
@@ -5,3 +5,4 @@
|
||||
##### Voice options
|
||||
test_phon ka "s'asi,amovn,oa t#k#v'eni g'ats#noba
|
||||
r'ogor brdz'andebit#" "სასიამოვნოა თქვენი გაცნობა. როგორ ბრძანდებით" "lowercaseSentence" #872
|
||||
test_phon fi "'a:b,e:s,e:" "abc" "spelling_stress"
|
||||
|
||||
Reference in New Issue
Block a user