mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-12 00:46:50 +00:00
Merge branch 'upstream' into development
Conflicts: dictsource/dict_phonemes
This commit is contained in:
@@ -1958,6 +1958,7 @@ int CompileDictionary(const char *dsource, const char *dict_name, FILE *log, cha
|
||||
fseek(f_out,4,SEEK_SET);
|
||||
Write4Bytes(f_out,offset_rules);
|
||||
fclose(f_out);
|
||||
fflush(f_log);
|
||||
|
||||
LoadDictionary(translator, dict_name, 0);
|
||||
|
||||
|
||||
+3
-3
@@ -1090,7 +1090,7 @@ int Wavegen_Klatt(int resume)
|
||||
}
|
||||
for(ix=1; ix < 7; ix++)
|
||||
{
|
||||
kt_frame.Ap[ix] = 0;
|
||||
kt_frame.Ap[ix] = peaks[ix].ap;
|
||||
}
|
||||
|
||||
kt_frame.AVdb = klattp[KLATT_AV];
|
||||
@@ -1333,12 +1333,12 @@ if(option_log_frames)
|
||||
{
|
||||
peaks[ix].bp1 = fr1->klatt_bp[ix] * 4; // parallel bandwidth
|
||||
peaks[ix].bp = (int)peaks[ix].bp1;
|
||||
next = fr2->klatt_bp[ix] * 2;
|
||||
next = fr2->klatt_bp[ix] * 4;
|
||||
peaks[ix].bp_inc = ((next - peaks[ix].bp1) * STEPSIZE) / length;
|
||||
|
||||
peaks[ix].ap1 = fr1->klatt_ap[ix]; // parallal amplitude
|
||||
peaks[ix].ap = (int)peaks[ix].ap1;
|
||||
next = fr2->klatt_ap[ix] * 2;
|
||||
next = fr2->klatt_ap[ix];
|
||||
peaks[ix].ap_inc = ((next - peaks[ix].ap1) * STEPSIZE) / length;
|
||||
}
|
||||
}
|
||||
|
||||
+32
-5
@@ -1414,6 +1414,7 @@ static int LookupNum2(Translator *tr, int value, const int control, char *ph_out
|
||||
// control bit 4: speak zero tens
|
||||
// control bit 5: variant of ordinal number (lang=hu)
|
||||
// bit 8 followed by decimal fraction
|
||||
// bit 9: use #f form for both tens and units (lang=ml)
|
||||
|
||||
int found;
|
||||
int ix;
|
||||
@@ -1458,9 +1459,13 @@ static int LookupNum2(Translator *tr, int value, const int control, char *ph_out
|
||||
// is there a special pronunciation for this 2-digit number
|
||||
if(control & 8)
|
||||
{
|
||||
// is there a feminine form?
|
||||
sprintf(string,"_%df",value);
|
||||
found = Lookup(tr, string, ph_digits);
|
||||
// is there a feminine or thousands-variant form?
|
||||
sprintf(string,"_%dfx",value);
|
||||
if((found = Lookup(tr, string, ph_digits)) == 0)
|
||||
{
|
||||
sprintf(string,"_%df",value);
|
||||
found = Lookup(tr, string, ph_digits);
|
||||
}
|
||||
}
|
||||
else if(is_ordinal)
|
||||
{
|
||||
@@ -1549,7 +1554,10 @@ static int LookupNum2(Translator *tr, int value, const int control, char *ph_out
|
||||
}
|
||||
if(found_ordinal == 0)
|
||||
{
|
||||
sprintf(string,"_%dX", tens);
|
||||
if(control & 0x200)
|
||||
sprintf(string, "_%dXf", tens);
|
||||
else
|
||||
sprintf(string,"_%dX", tens);
|
||||
Lookup(tr, string, ph_tens);
|
||||
}
|
||||
|
||||
@@ -1704,6 +1712,7 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, int suppress_null
|
||||
int ordinal;
|
||||
int tplex;
|
||||
int say_zero_hundred=0;
|
||||
int say_one_hundred;
|
||||
char string[12]; // for looking up entries in **_list
|
||||
char buf1[100];
|
||||
char buf2[100];
|
||||
@@ -1772,6 +1781,8 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, int suppress_null
|
||||
x = 0;
|
||||
if(tr->langopts.numbers2 & (1 << tplex))
|
||||
x = 8; // use variant (feminine) for before thousands and millions
|
||||
if(tr->translator_name == L('m','l'))
|
||||
x = 0x208;
|
||||
LookupNum2(tr, hundreds/10, x, ph_digits);
|
||||
}
|
||||
|
||||
@@ -1784,6 +1795,7 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, int suppress_null
|
||||
if((hundreds == 0) && (say_zero_hundred == 0))
|
||||
ph_100[0] = 0;
|
||||
suppress_null = 1;
|
||||
control |= 1;
|
||||
}
|
||||
|
||||
ph_digits[0] = 0;
|
||||
@@ -1838,7 +1850,17 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, int suppress_null
|
||||
}
|
||||
else
|
||||
{
|
||||
if((hundreds > 1) || ((tr->langopts.numbers & NUM_OMIT_1_HUNDRED) == 0))
|
||||
say_one_hundred = 1;
|
||||
if(hundreds == 1)
|
||||
{
|
||||
if((tr->langopts.numbers & NUM_OMIT_1_HUNDRED) != 0)
|
||||
say_one_hundred = 0;
|
||||
|
||||
if(((tr->langopts.numbers2 & NUM2_OMIT_1_HUNDRED_ONLY) != 0) && ((control & 1)==0))
|
||||
say_one_hundred = 0;
|
||||
}
|
||||
|
||||
if(say_one_hundred != 0)
|
||||
{
|
||||
LookupNum2(tr, hundreds, 0, ph_digits);
|
||||
}
|
||||
@@ -1894,6 +1916,11 @@ static int LookupNum3(Translator *tr, int value, char *ph_out, int suppress_null
|
||||
x = 8; // use variant (feminine) for before thousands and millions
|
||||
}
|
||||
|
||||
if((tr->translator_name == L('m','l')) && (thousandplex == 1))
|
||||
{
|
||||
x |= 0x208; // use #f form for both tens and units
|
||||
}
|
||||
|
||||
if(LookupNum2(tr, tensunits, x | (control & 0x100), buf2) != 0)
|
||||
{
|
||||
if(tr->langopts.numbers & NUM_SINGLE_AND)
|
||||
|
||||
+2
-1
@@ -509,9 +509,10 @@ void MakePhonemeList(Translator *tr, int post_pause, int start_sentence)
|
||||
if((plist3+1)->synthflags & SFLAG_LENGTHEN)
|
||||
{
|
||||
static char types_double[] = {phFRICATIVE,phVFRICATIVE,phNASAL,phLIQUID,0};
|
||||
if(strchr(types_double,next->type))
|
||||
if((j > 0) && (strchr(types_double,next->type)))
|
||||
{
|
||||
// lengthen this consonant by doubling it
|
||||
// BUT, can't insert a phoneme at position plist3[0] because it crashes PrevPh()
|
||||
insert_ph = next->code;
|
||||
(plist3+1)->synthflags ^= SFLAG_LENGTHEN;
|
||||
}
|
||||
|
||||
+1
-1
@@ -773,7 +773,7 @@ void SpectSeq::InterpolateAdjacent(void)
|
||||
p->pkfreq = p1->pkfreq + int((p2->pkfreq - p1->pkfreq)*ratio);
|
||||
p->pkheight=p1->pkheight+int((p2->pkheight-p1->pkheight)*ratio);
|
||||
p->pkwidth = p1->pkwidth + int((p2->pkwidth - p1->pkwidth)*ratio);
|
||||
p->pkright =p1->pkright + int((p2->pkright - p2->pkright)*ratio);
|
||||
p->pkright =p1->pkright + int((p2->pkright - p1->pkright)*ratio);
|
||||
}
|
||||
frames[select]->keyframe = 1;
|
||||
formantdlg->ShowFrame(this,select,1,0xff);
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
#include "translate.h"
|
||||
#include "wave.h"
|
||||
|
||||
const char *version_string = "1.47.11 03.May.13";
|
||||
const char *version_string = "1.47.11a 18.May.13";
|
||||
const int version_phdata = 0x014709;
|
||||
|
||||
int option_device_number = -1;
|
||||
|
||||
@@ -237,6 +237,7 @@ static const char transpose_map_latin[] = {
|
||||
|
||||
tr->charset_a0 = charsets[1]; // ISO-8859-1, this is for when the input is not utf8
|
||||
dictionary_name[0] = 0;
|
||||
tr->dictionary_name[0] = 0;
|
||||
tr->dict_condition=0;
|
||||
tr->dict_min_size = 0;
|
||||
tr->data_dictrules = NULL; // language_1 translation rules file
|
||||
@@ -471,12 +472,13 @@ Translator *SelectTranslator(const char *name)
|
||||
static const short stress_lengths_ta2[8] = {230, 230, 240, 240, 0, 0, 260, 260};
|
||||
static const unsigned char stress_amps_ta[8] = {18,18, 18,18, 20,20, 22,22 };
|
||||
|
||||
tr = NewTranslator();
|
||||
strcpy(tr->dictionary_name, name);
|
||||
|
||||
// convert name string into a word of up to 4 characters, for the switch()
|
||||
while(*name != 0)
|
||||
name2 = (name2 << 8) + *name++;
|
||||
|
||||
tr = NewTranslator();
|
||||
|
||||
switch(name2)
|
||||
{
|
||||
case L('a','f'):
|
||||
@@ -898,6 +900,8 @@ SetupTranslator(tr,stress_lengths_equal,stress_amps_equal);
|
||||
static const short stress_lengths_hr[8] = {180,160, 200,200, 0,0, 220,230};
|
||||
static const short stress_lengths_sr[8] = {160,150, 200,200, 0,0, 250,260};
|
||||
|
||||
strcpy(tr->dictionary_name, "hbs");
|
||||
|
||||
if(name2 == L('s','r'))
|
||||
SetupTranslator(tr,stress_lengths_sr,stress_amps_hr);
|
||||
else
|
||||
@@ -1395,6 +1399,7 @@ SetLengthMods(tr,3); // all equal
|
||||
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_SWAP_TENS | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_2 | NUM_ORDINAL_DOT | NUM_ROMAN;
|
||||
tr->langopts.numbers2 = 0x100; // plural forms of millions etc
|
||||
tr->langopts.thousands_sep = ' '; // don't allow dot as thousands separator
|
||||
tr->langopts.replace_chars = replace_cyrillic_latin;
|
||||
break;
|
||||
|
||||
case L('s','q'): // Albanian
|
||||
@@ -1477,6 +1482,7 @@ SetLengthMods(tr,3); // all equal
|
||||
{
|
||||
tr->letter_bits_offset = OFFSET_MALAYALAM;
|
||||
tr->langopts.numbers = NUM_OMIT_1_THOUSAND;
|
||||
tr->langopts.numbers2 = NUM2_OMIT_1_HUNDRED_ONLY;
|
||||
}
|
||||
else
|
||||
if(name2 == L('k','n'))
|
||||
|
||||
+2
-1
@@ -1735,7 +1735,8 @@ int SetTranslator2(const char *new_language)
|
||||
translator2->phoneme_tab_ix = new_phoneme_tab;
|
||||
}
|
||||
}
|
||||
translator2->phonemes_repeat[0] = 0;
|
||||
if(translator2 != NULL)
|
||||
translator2->phonemes_repeat[0] = 0;
|
||||
return(new_phoneme_tab);
|
||||
} // end of SetTranslator2
|
||||
|
||||
|
||||
@@ -510,6 +510,7 @@ typedef struct {
|
||||
#define NUM2_MYRIADS 0x4000
|
||||
#define NUM2_ENGLISH_NUMERALS 0x8000
|
||||
#define NUM2_PERCENT_BEFORE 0x10000
|
||||
#define NUM2_OMIT_1_HUNDRED_ONLY 0x20000
|
||||
// bits 1-4 use variant form of numbers before thousands,millions,etc.
|
||||
// bits 6-8 use different forms of thousand, million, etc (M MA MB)
|
||||
// bit9=(LANG=rw) say "thousand" and "million" before its number, not after
|
||||
@@ -519,6 +520,7 @@ typedef struct {
|
||||
// bit14=(LANG=ko) use myriads (groups of 4 digits) not thousands (groups of 3)
|
||||
// bit15=(LANG=ne) speak (non-replaced) English numerals in English
|
||||
// bit16=(LANG=si) say "%" before the number
|
||||
// bit17=(LANG=ml) omit "one" before hundred only if there are no previous digits
|
||||
int numbers2;
|
||||
|
||||
#define BREAK_THOUSANDS 0x49249248
|
||||
|
||||
Reference in New Issue
Block a user