mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-03 22:26:48 +00:00
Merge branch 'upstream' into development
Conflicts: dictsource/dict_phonemes dictsource/pt_list dictsource/pt_rules phsource/compile_report phsource/vowel/uu#_2 src/synthdata.cpp src/translate.h
This commit is contained in:
+22
-2
@@ -3418,6 +3418,24 @@ memset(markers_used,0,sizeof(markers_used));
|
||||
|
||||
f_errors = stderr;
|
||||
|
||||
if(!wxDirExists(path_phsource))
|
||||
{
|
||||
if(gui_flag)
|
||||
{
|
||||
wxString dirname = wxDirSelector(_T("Phoneme source directory"),path_phsource);
|
||||
if(!dirname.IsEmpty())
|
||||
{
|
||||
path_phsource = dirname;
|
||||
strncpy0(path_source,path_phsource.mb_str(wxConvLocal),sizeof(path_source)-1);
|
||||
strcat(path_source,"/");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr,"Can't find phoneme source directory: %s\n",path_source);
|
||||
}
|
||||
}
|
||||
|
||||
strncpy0(current_fname,source,sizeof(current_fname));
|
||||
|
||||
strncpy0(fname,path_phfile.mb_str(wxConvLocal),sizeof(fname));
|
||||
@@ -3520,8 +3538,10 @@ memset(markers_used,0,sizeof(markers_used));
|
||||
fprintf(f_errors,"\nRefs %d, Reused %d\n",count_references,duplicate_references);
|
||||
fclose(f_in);
|
||||
fclose(f_phdata);
|
||||
fclose(f_errors);
|
||||
fclose(f_prog_log);
|
||||
if(f_errors != stderr)
|
||||
fclose(f_errors);
|
||||
if(f_prog_log != NULL)
|
||||
fclose(f_prog_log);
|
||||
fclose(f_phindex);
|
||||
fclose(f_phtab);
|
||||
fclose(f_phcontents);
|
||||
|
||||
@@ -1919,6 +1919,22 @@ static int TranslateNumber_1(Translator *tr, char *word, char *ph_out, unsigned
|
||||
n_digit_lookup = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if((tr->langopts.numbers2 & NUM2_PERCENT_BEFORE) && (prev_thousands == 0))
|
||||
{
|
||||
// LANG=si, say "percent" before the number
|
||||
p2 = word;
|
||||
while((*p2 != ' ') && (*p2 != 0))
|
||||
{
|
||||
p2++;
|
||||
}
|
||||
if(p2[1] == '%')
|
||||
{
|
||||
Lookup(tr, "%", ph_out);
|
||||
ph_out += strlen(ph_out);
|
||||
p2[1] = ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LookupNum3(tr, value, ph_buf, suppress_null, thousandplex, prev_thousands | ordinal);
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
#include "translate.h"
|
||||
#include "wave.h"
|
||||
|
||||
const char *version_string = "1.46.26 17.Sep.12";
|
||||
const char *version_string = "1.46.27 21.Oct.12";
|
||||
const int version_phdata = 0x014624;
|
||||
|
||||
int option_device_number = -1;
|
||||
|
||||
@@ -915,7 +915,7 @@ SetLengthMods(tr,3); // all equal
|
||||
tr->letter_bits_offset = OFFSET_GEORGIAN;
|
||||
// tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words
|
||||
tr->langopts.max_initial_consonants = 7;
|
||||
tr->langopts.numbers = NUM_VIGESIMAL | NUM_AND_UNITS | NUM_OMIT_1_HUNDRED |NUM_OMIT_1_THOUSAND | NUM_DFRACTION_5;
|
||||
tr->langopts.numbers = NUM_VIGESIMAL | NUM_AND_UNITS | NUM_OMIT_1_HUNDRED |NUM_OMIT_1_THOUSAND | NUM_DFRACTION_5 | NUM_ROMAN;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1207,7 +1207,9 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words
|
||||
tr->langopts.suffix_add_e = tr->letter_bits_offset + 0x4a; //virama
|
||||
tr->langopts.numbers = NUM_OMIT_1_THOUSAND ;
|
||||
tr->langopts.numbers = NUM_OMIT_1_THOUSAND;
|
||||
tr->langopts.numbers2 = NUM2_PERCENT_BEFORE;
|
||||
tr->langopts.break_numbers = 0x14aa8; // for languages which have numbers for 100,000 and 100,00,000, eg Hindi
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
+7
-4
@@ -444,15 +444,17 @@ typedef struct {
|
||||
// bit27= Roman numbers are ordinal numbers
|
||||
int numbers;
|
||||
|
||||
#define NUM2_MULTIPLE_ORDINAL 0x1000
|
||||
#define NUM2_NO_TEEN_ORDINALS 0x2000
|
||||
#define NUM2_MYRIADS 0x4000
|
||||
#define NUM2_ENGLISH_NUMERALS 0x8000
|
||||
#define NUM2_THOUSANDS_VAR1 0x40
|
||||
#define NUM2_THOUSANDS_VAR2 0x80
|
||||
#define NUM2_THOUSANDS_VAR3 0xc0
|
||||
#define NUM2_THOUSANDS_VAR4 0x100
|
||||
#define NUM2_THOUSANDS_VAR5 0x140
|
||||
|
||||
#define NUM2_MULTIPLE_ORDINAL 0x1000
|
||||
#define NUM2_NO_TEEN_ORDINALS 0x2000
|
||||
#define NUM2_MYRIADS 0x4000
|
||||
#define NUM2_ENGLISH_NUMERALS 0x8000
|
||||
#define NUM2_PERCENT_BEFORE 0x10000
|
||||
// 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
|
||||
@@ -460,6 +462,7 @@ typedef struct {
|
||||
// bit13=(LANG=pt) don't use 11-19 numbers to make ordinals
|
||||
// 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
|
||||
int numbers2;
|
||||
|
||||
#define BREAK_THOUSANDS 0x49249248
|
||||
|
||||
Reference in New Issue
Block a user