Don't allow the gender property to be set in language files (they are only relevant in voice files).

This commit is contained in:
Reece H. Dunn
2017-02-05 19:56:07 +00:00
parent 1c5bbe31a4
commit 36a2872b4b
67 changed files with 10 additions and 95 deletions
-1
View File
@@ -1,6 +1,5 @@
name Vietnamese (Northern) name Vietnamese (Northern)
language vi language vi
gender male
words 1 words 1
pitch 80 118 pitch 80 118
-1
View File
@@ -2,7 +2,6 @@ name Vietnamese (Central)
language vi-vn-x-central language vi-vn-x-central
phonemes vi-hue phonemes vi-hue
dictrules 1 dictrules 1
gender male
words 1 words 1
pitch 82 118 //80 118 pitch 82 118 //80 118
-1
View File
@@ -2,7 +2,6 @@ name Vietnamese (Southern)
language vi-vn-x-south language vi-vn-x-south
phonemes vi-sgn phonemes vi-sgn
dictrules 2 dictrules 2
gender male
words 1 words 1
pitch 82 118 //80 118 pitch 82 118 //80 118
-1
View File
@@ -1,5 +1,4 @@
name Esperanto name Esperanto
language eo language eo
gender male
apostrophe 2 apostrophe 2
-1
View File
@@ -1,6 +1,5 @@
name Lingua Franca Nova name Lingua Franca Nova
language lfn language lfn
gender male
phonemes base2 phonemes base2
l_unpronouncable 0 l_unpronouncable 0
-1
View File
@@ -1,6 +1,5 @@
name Nahuatl (Classical) name Nahuatl (Classical)
language nci language nci
gender male
intonation 3 intonation 3
stressrule 2 stressrule 2
-2
View File
@@ -1,4 +1,2 @@
name Lithuanian name Lithuanian
language lt language lt
gender male
-1
View File
@@ -1,6 +1,5 @@
name Latvian name Latvian
language lv language lv
gender male
maintainer Valdis Vitolins <valdis.vitolins@odo.lv> maintainer Valdis Vitolins <valdis.vitolins@odo.lv>
status mature status mature
words 0 2 words 0 2
-1
View File
@@ -1,5 +1,4 @@
name Swahili name Swahili
language sw language sw
gender male
status testing status testing
-1
View File
@@ -1,5 +1,4 @@
name Setswana name Setswana
language tn language tn
gender male
status testing status testing
-1
View File
@@ -1,5 +1,4 @@
name Welsh name Welsh
language cy language cy
gender male
intonation 4 intonation 4
-1
View File
@@ -1,6 +1,5 @@
name Malayalam name Malayalam
language ml language ml
gender male
intonation 2 intonation 2
//consonants 80 //consonants 80
-1
View File
@@ -1,6 +1,5 @@
name Tamil name Tamil
language ta language ta
gender male
intonation 2 intonation 2
consonants 80 consonants 80
-3
View File
@@ -1,7 +1,4 @@
name Danish name Danish
language da language da
gender male
tunes s2 c2 q2 e2 tunes s2 c2 q2 e2
-2
View File
@@ -1,4 +1,2 @@
name Icelandic name Icelandic
language is language is
gender male
-1
View File
@@ -1,6 +1,5 @@
name Norwegian name Norwegian
language no language no
language nb language nb
gender male
intonation 4 intonation 4
-2
View File
@@ -1,4 +1,2 @@
name Swedish name Swedish
language sv language sv
gender male
-1
View File
@@ -1,6 +1,5 @@
name Afrikaans name Afrikaans
language af language af
gender male
maintainer Christo de Klerk <christodeklerk@gmail.com> maintainer Christo de Klerk <christodeklerk@gmail.com>
status mature status mature
-3
View File
@@ -1,5 +1,2 @@
name German name German
language de language de
gender male
-1
View File
@@ -1,7 +1,6 @@
name English (Great Britain) name English (Great Britain)
language en-gb 2 language en-gb 2
language en 2 language en 2
gender male
maintainer Reece H. Dunn <msclrhd@gmail.com> maintainer Reece H. Dunn <msclrhd@gmail.com>
status mature status mature
-1
View File
@@ -1,7 +1,6 @@
name English (Caribbean) name English (Caribbean)
language en-029 language en-029
language en 10 language en 10
gender male
maintainer Reece H. Dunn <msclrhd@gmail.com> maintainer Reece H. Dunn <msclrhd@gmail.com>
status mature status mature
-1
View File
@@ -1,7 +1,6 @@
name English (Scotland) name English (Scotland)
language en-gb-scotland language en-gb-scotland
language en 4 language en 4
gender male
maintainer Reece H. Dunn <msclrhd@gmail.com> maintainer Reece H. Dunn <msclrhd@gmail.com>
status mature status mature
-3
View File
@@ -2,7 +2,6 @@ name English (Lancaster)
language en-gb-x-gbclan language en-gb-x-gbclan
language en-gb 3 language en-gb 3
language en 5 language en 5
gender male
maintainer Reece H. Dunn <msclrhd@gmail.com> maintainer Reece H. Dunn <msclrhd@gmail.com>
status mature status mature
@@ -14,5 +13,3 @@ stressLength 160 150 180 180 220 220 290 290
replace 00 i@3 i@ replace 00 i@3 i@
replace 03 N n replace 03 N n
replace 03 i I2 replace 03 i I2
-1
View File
@@ -2,7 +2,6 @@ name English (West Midlands)
language en-gb-x-gbcwmd language en-gb-x-gbcwmd
language en-gb 9 language en-gb 9
language en 9 language en 9
gender male
phonemes en-wm phonemes en-wm
-1
View File
@@ -2,7 +2,6 @@ name English (Received Pronunciation)
language en-gb-x-rp language en-gb-x-rp
language en-gb 4 language en-gb 4
language en 5 language en 5
gender male
maintainer Reece H. Dunn <msclrhd@gmail.com> maintainer Reece H. Dunn <msclrhd@gmail.com>
status mature status mature
-2
View File
@@ -1,7 +1,6 @@
name English (America) name English (America)
language en-us 2 language en-us 2
language en 3 language en 3
gender male
maintainer Reece H. Dunn <msclrhd@gmail.com> maintainer Reece H. Dunn <msclrhd@gmail.com>
status mature status mature
@@ -15,4 +14,3 @@ stressAmp 17 16 19 19 19 19 21 19
replace 03 I i replace 03 I i
replace 03 I2 i replace 03 I2 i
-1
View File
@@ -1,3 +1,2 @@
name Dutch name Dutch
language nl language nl
gender male
-3
View File
@@ -1,5 +1,2 @@
name Greek (Modern) name Greek (Modern)
language el language el
gender male
-2
View File
@@ -1,8 +1,6 @@
name Greek (Ancient) name Greek (Ancient)
language grc language grc
gender male
stressLength 170 170 190 190 0 0 230 240 stressLength 170 170 190 190 0 0 230 240
dictrules 1 dictrules 1
words 3 words 3
-1
View File
@@ -1,3 +1,2 @@
name Bengali name Bengali
language bn language bn
gender male
-1
View File
@@ -1,3 +1,2 @@
name Hindi name Hindi
language hi language hi
gender male
-1
View File
@@ -1,5 +1,4 @@
name Nepali name Nepali
language ne language ne
gender male
dictrules 1 dictrules 1
-1
View File
@@ -1,3 +1,2 @@
name Armenian (East Armenia) name Armenian (East Armenia)
language hy language hy
gender male
-2
View File
@@ -1,7 +1,6 @@
name Armenian (West Armenia) name Armenian (West Armenia)
language hy-arevmda language hy-arevmda
language hy 8 language hy 8
gender male
dictrules 1 dictrules 1
@@ -19,4 +18,3 @@ replace 00 tS dZ
replace 00 k g replace 00 k g
replace 00 R2 R // ?? replace 00 R2 R // ??
-1
View File
@@ -1,6 +1,5 @@
name Albanian name Albanian
language sq language sq
gender male
// add this line to remove 'ë' at the end of words // add this line to remove 'ë' at the end of words
// replace 00 @/ NULL // replace 00 @/ NULL
-1
View File
@@ -1,6 +1,5 @@
name Kurdish name Kurdish
language ku language ku
gender male
//words 1 48 //words 1 48
-1
View File
@@ -1,6 +1,5 @@
name Latin name Latin
language la language la
gender male
stressrule 2 33 0 2 stressrule 2 33 0 2
// rule=penultimate // rule=penultimate
// flags=0100001 (no automatic secondary stress + don't stres monosyllables) // flags=0100001 (no automatic secondary stress + don't stres monosyllables)
-1
View File
@@ -1,6 +1,5 @@
name Japanese name Japanese
language jp language jp
phonemes jp phonemes jp
gender male
intonation 4 intonation 4
-1
View File
@@ -1,6 +1,5 @@
name Korean name Korean
language ko language ko
gender male
pitch 80 118 pitch 80 118
intonation 2 intonation 2
-1
View File
@@ -1,6 +1,5 @@
name Indonesian name Indonesian
language id language id
gender male
stressLength 160 200 180 180 0 0 220 240 stressLength 160 200 180 180 0 0 220 240
stressAmp 16 18 18 18 0 0 22 21 stressAmp 16 18 18 18 0 0 22 21
-1
View File
@@ -1,7 +1,6 @@
// Last updated: 14 October 2010, Jason Ong (jason@portalgroove.com) // Last updated: 14 October 2010, Jason Ong (jason@portalgroove.com)
name Malay name Malay
language ms language ms
gender male
phonemes id phonemes id
translator id translator id
-1
View File
@@ -1,3 +1,2 @@
name Aragonese name Aragonese
language an language an
gender male
-2
View File
@@ -1,4 +1,2 @@
name Catalan name Catalan
language ca language ca
gender male
-1
View File
@@ -1,5 +1,4 @@
name Spanish (Spain) name Spanish (Spain)
language es language es
gender male
dictrules 1 dictrules 1
tunes s6 c6 q6 e6 tunes s6 c6 q6 e6
-1
View File
@@ -2,7 +2,6 @@ name Spanish (Latin America)
language es-419 language es-419
language es-mx 6 language es-mx 6
language es 6 language es 6
gender male
phonemes es-la phonemes es-la
dictrules 2 dictrules 2
-1
View File
@@ -1,7 +1,6 @@
name French (France) name French (France)
language fr-fr language fr-fr
language fr language fr
gender male
dictrules 1 dictrules 1
tunes s3 c3 q3 e3 tunes s3 c3 q3 e3
-1
View File
@@ -1,7 +1,6 @@
name French (Belgium) name French (Belgium)
language fr-be language fr-be
language fr 8 language fr 8
gender male
dictrules 2 dictrules 2
tunes s3 c3 q3 e3 tunes s3 c3 q3 e3
-2
View File
@@ -1,9 +1,7 @@
name Italian name Italian
language it language it
gender male
maintainer Christian Leo M <llajta2012@gmail.com> maintainer Christian Leo M <llajta2012@gmail.com>
status mature status mature
tunes s4 c4 q4 e4 tunes s4 c4 q4 e4
-1
View File
@@ -1,7 +1,6 @@
name Portuguese (Brazil) name Portuguese (Brazil)
language pt-br language pt-br
language pt language pt
gender male
dictrules 2 dictrules 2
stressLength 200 115 230 230 0 0 250 270 stressLength 200 115 230 230 0 0 250 270
-1
View File
@@ -1,7 +1,6 @@
name Portuguese (Portugal) name Portuguese (Portugal)
language pt-pt language pt-pt
language pt 6 language pt 6
gender male
phonemes pt-pt phonemes pt-pt
dictrules 1 dictrules 1
-1
View File
@@ -1,3 +1,2 @@
name Romanian name Romanian
language ro language ro
gender male
-1
View File
@@ -1,7 +1,6 @@
name Arabic name Arabic
language ar language ar
phonemes ar phonemes ar
gender male
pitch 160 120 pitch 160 120
roughness 0 roughness 0
speed 70 speed 70
-1
View File
@@ -1,6 +1,5 @@
name Chinese (Mandarin) name Chinese (Mandarin)
language zh language zh
gender male
words 1 words 1
pitch 80 118 pitch 80 118
-1
View File
@@ -6,7 +6,6 @@ language zhy
translator zhy translator zhy
phonemes zhy phonemes zhy
dictionary zhy dictionary zhy
gender male
// interpret English letters as 1=English words, 2=jyutping // interpret English letters as 1=English words, 2=jyutping
dictrules 1 dictrules 1
-2
View File
@@ -1,4 +1,2 @@
name Turkish name Turkish
language tr language tr
gender male
-1
View File
@@ -1,3 +1,2 @@
name Tatar name Tatar
language tt language tt
gender male
-2
View File
@@ -1,4 +1,2 @@
name Finnish name Finnish
language fi language fi
gender male
-1
View File
@@ -1,6 +1,5 @@
name Hungarian name Hungarian
language hu language hu
gender male
option bracket 0 0 option bracket 0 0
pitch 81 117 pitch 81 117
-1
View File
@@ -2,7 +2,6 @@ name Bosnian
language bs language bs
phonemes hr phonemes hr
dictionary hbs dictionary hbs
gender male
pitch 81 120 pitch 81 120
formant 0 100 100 100 formant 0 100 100 100
-2
View File
@@ -1,4 +1,2 @@
name Czech name Czech
language cs language cs
gender male
-1
View File
@@ -1,7 +1,6 @@
name Croatian name Croatian
language hr language hr
language hbs language hbs
gender male
dictionary hbs dictionary hbs
-2
View File
@@ -1,4 +1,2 @@
name Macedonian name Macedonian
language mk language mk
gender male
-1
View File
@@ -1,5 +1,4 @@
name Polish name Polish
language pl language pl
gender male
intonation 2 intonation 2
-1
View File
@@ -1,6 +1,5 @@
name Russian name Russian
language ru language ru
gender male
replace 03 a a# replace 03 a a#
-2
View File
@@ -1,4 +1,2 @@
name Slovak name Slovak
language sk language sk
gender male
-1
View File
@@ -1,6 +1,5 @@
name Serbian name Serbian
language sr language sr
gender male
dictionary hbs dictionary hbs
// attributes towards !variant3 pitch 80 120 // attributes towards !variant3 pitch 80 120
+10 -8
View File
@@ -265,7 +265,7 @@ void ReadTonePoints(char *string, int *tone_pts)
&tone_pts[8], &tone_pts[9]); &tone_pts[8], &tone_pts[9]);
} }
static espeak_VOICE *ReadVoiceFile(FILE *f_in, const char *fname) static espeak_VOICE *ReadVoiceFile(FILE *f_in, const char *fname, int is_language_file)
{ {
// Read a Voice file, allocate a VOICE_DATA and set data from the // Read a Voice file, allocate a VOICE_DATA and set data from the
// file's language, gender, name lines // file's language, gender, name lines
@@ -320,6 +320,8 @@ static espeak_VOICE *ReadVoiceFile(FILE *f_in, const char *fname)
break; break;
case V_GENDER: case V_GENDER:
sscanf(p, "%s %d", vgender, &age); sscanf(p, "%s %d", vgender, &age);
if (is_language_file)
fprintf(stderr, "Error (%s): gender attribute specified on a language file\n", fname);
break; break;
case V_VARIANTS: case V_VARIANTS:
sscanf(p, "%d", &n_variants); sscanf(p, "%d", &n_variants);
@@ -1389,7 +1391,7 @@ char const *SelectVoice(espeak_VOICE *voice_select, int *found)
return vp->identifier; return vp->identifier;
} }
static void GetVoices(const char *path, int len_path_voices) static void GetVoices(const char *path, int len_path_voices, int is_language_file)
{ {
FILE *f_voice; FILE *f_voice;
espeak_VOICE *voice_data; espeak_VOICE *voice_data;
@@ -1416,14 +1418,14 @@ static void GetVoices(const char *path, int len_path_voices)
if (ftype == -EISDIR) { if (ftype == -EISDIR) {
// a sub-directory // a sub-directory
GetVoices(fname, len_path_voices); GetVoices(fname, len_path_voices, is_language_file);
} else if (ftype > 0) { } else if (ftype > 0) {
// a regular file, add it to the voices list // a regular file, add it to the voices list
if ((f_voice = fopen(fname, "r")) == NULL) if ((f_voice = fopen(fname, "r")) == NULL)
continue; continue;
// pass voice file name within the voices directory // pass voice file name within the voices directory
voice_data = ReadVoiceFile(f_voice, fname+len_path_voices); voice_data = ReadVoiceFile(f_voice, fname+len_path_voices, is_language_file);
fclose(f_voice); fclose(f_voice);
if (voice_data != NULL) if (voice_data != NULL)
@@ -1452,14 +1454,14 @@ static void GetVoices(const char *path, int len_path_voices)
if (ftype == -EISDIR) { if (ftype == -EISDIR) {
// a sub-directory // a sub-directory
GetVoices(fname, len_path_voices); GetVoices(fname, len_path_voices, is_language_file);
} else if (ftype > 0) { } else if (ftype > 0) {
// a regular file, add it to the voices list // a regular file, add it to the voices list
if ((f_voice = fopen(fname, "r")) == NULL) if ((f_voice = fopen(fname, "r")) == NULL)
continue; continue;
// pass voice file name within the voices directory // pass voice file name within the voices directory
voice_data = ReadVoiceFile(f_voice, fname+len_path_voices); voice_data = ReadVoiceFile(f_voice, fname+len_path_voices, is_language_file);
fclose(f_voice); fclose(f_voice);
if (voice_data != NULL) if (voice_data != NULL)
@@ -1567,10 +1569,10 @@ ESPEAK_API const espeak_VOICE **espeak_ListVoices(espeak_VOICE *voice_spec)
FreeVoiceList(); FreeVoiceList();
sprintf(path_voices, "%s%cvoices", path_home, PATHSEP); sprintf(path_voices, "%s%cvoices", path_home, PATHSEP);
GetVoices(path_voices, strlen(path_voices)+1); GetVoices(path_voices, strlen(path_voices)+1, 0);
sprintf(path_voices, "%s%clang", path_home, PATHSEP); sprintf(path_voices, "%s%clang", path_home, PATHSEP);
GetVoices(path_voices, strlen(path_voices)+1); GetVoices(path_voices, strlen(path_voices)+1, 1);
voices_list[n_voices_list] = NULL; // voices list terminator voices_list[n_voices_list] = NULL; // voices list terminator
espeak_VOICE **new_voices = (espeak_VOICE **)realloc(voices, sizeof(espeak_VOICE *)*(n_voices_list+1)); espeak_VOICE **new_voices = (espeak_VOICE **)realloc(voices, sizeof(espeak_VOICE *)*(n_voices_list+1));