diff --git a/dictsource/en_list b/dictsource/en_list index 32f992d6..c3f21695 100644 --- a/dictsource/en_list +++ b/dictsource/en_list @@ -61,6 +61,7 @@ a eI $atend // use the $accent attribute here to force the use of the // accent table when speaking the name of the character. à $accent $atend // this can be a word +á $accent $atend ç $accent é $accent ê $accent @@ -3214,7 +3215,7 @@ Korean kOr'i:@n Kosovo k0s@voU Kuala kwA:la# Lagos leIg0s -Lebanon lEba#n@n +Lebanon lEb@n0n Leipzig laIpsIg Leone li:'oUn Lesotho l@s'u:tu: @@ -3908,8 +3909,8 @@ would $u+ $verbf $only $strend2 (would have) w%Udh%a#v $pastf (would have) wUdhav $pastf $atend (would have to) wUdhavt@5 $u2 $verbf $strend2 -(wouldn't have) wUdnt@v $u1 $pastf $strend2 -(wouldn't have to) ,wUdntavt@5 $verbf $strend2 +(wouldn't have) wUd@-nt@v $u1 $pastf $strend2 +(wouldn't have to) ,wUd@-ntavt@5 $verbf $strend2 won't woUnt $u+ $verbf $strend2 $only wouldst $u+ (won't have) woUnta#v $pastf $u1 @@ -3920,18 +3921,18 @@ must $verbf (must have) mVsta#v $pastf $1 (must have) mVsthav $pastf $atend (must have to) m,Vstavt@5 $pastf -mustn't mVsnt $verbf -(mustn't have) mVsntha#v $pastf $u1+ -(mustn't have to) m'Vsnthavt@5 $pastf +mustn't mVs@-nt $verbf +(mustn't have) mVs@-ntha#v $pastf $u1+ +(mustn't have to) m'Vs@-nthavt@5 $pastf shall ,Sal $verbf $only $strend2 shalt ,Salt $verbf $only should ,SUd $verbf $only $strend2 (should have) SUd@v $pastf $u1+ (should have to) SUdhavt@5 $u2 $verbf $strend2 -shouldn't ,SUdnt $verbf $strend2 $only -(shouldn't have) SUdnth@v $pastf $u1+ -(shouldn't have to) 'SUdntavt@5 $verbf $strend2 +shouldn't ,SUd@-nt $verbf $strend2 $only +(shouldn't have) SUd@-nth@v $pastf $u1+ +(shouldn't have to) 'SUd@-ntavt@5 $verbf $strend2 shalln't ,SA:nt $verbf $strend2 shan't ,SA:nt $verbf $strend2 @@ -3947,9 +3948,9 @@ could %kUd $verbf $strend2 $only (could have) ,kUda#v $pastf (could have) kUdhav $pastf $atend (could have to) kUdhavt@5 $u2 $verbf $strend2 -couldn't ,kUd@nt $verbf $strend2 -(couldn't have) kUd@nt@v $pastf $u1+ -(couldn't have to) 'kUd@ntavt@5 $verbf $strend2 +couldn't ,kUd@-nt $verbf $strend2 +(couldn't have) kUd@-nt@v $pastf $u1+ +(couldn't have to) 'kUd@-ntavt@5 $verbf $strend2 may meI $verbf $strend2 (may have) meIha#v $pastf $u1+ @@ -3980,9 +3981,9 @@ had ,had $atend (had it) h,adI2t (had them) h,adDEm having ,havIN $strend2 $pastf $only -haven't hav@nt $pastf -hadn't had@nt $pastf -hasn't haz@nt $pastf +haven't hav@-nt $pastf +hadn't had@-nt $pastf +hasn't haz@-nt $pastf get %gEt $strend2 $pastf $only getting ,gEtIN $strend2 $pastf $only @@ -4088,8 +4089,8 @@ his hIz $u $nounf $only $strend2 her h3: $u $nounf $only hers h3:z $u $strend2 its Its $u $nounf -our aU@ $u $nounf $onlys -?3 our aU3 $u $nounf $onlys +our aU@ $u $nounf $only +?3 our aU3 $u $nounf $only your jO@ $u $nounf $only ?6 your jU@ $u $nounf $only their De@ $u $nounf $only diff --git a/dictsource/en_rules b/dictsource/en_rules index 715b4b11..ae1aae23 100644 --- a/dictsource/en_rules +++ b/dictsource/en_rules @@ -3827,7 +3827,8 @@ nk Nk ?7 nk nk // ?? Scottish n (kn n - n't nt + n't @-nt + A) n't nt E) n (_ @n B) n (_ @n g) n (ing+ n @@ -4847,7 +4848,7 @@ pro (vid pr@ pro (viden pr0 pro (vis pr@ - pro (voc pr@ + pro (voc pr%0# pro (vok pr@ pro (sec pr0 pro (fil proU @@ -6042,6 +6043,7 @@ χ tS'aI_ ψ ps'aI_ ω 'oUmIg@_ +?3 ω oUm'eIg@_ ώ 'oUmIg@_ ό 'oUmIkr0n_ diff --git a/dictsource/es_list b/dictsource/es_list index b7b3063d..9fc6458e 100644 --- a/dictsource/es_list +++ b/dictsource/es_list @@ -338,6 +338,7 @@ ll 'El^e é 'e||aTEntw'aDa í 'i||aTEntw'aDa _ó 'o||aTEntw'aDa +ó 'o||aTEntw'aDa $atend ú 'u||aTEntw'aDa ü ,uDj'ErEsis diff --git a/dictsource/ga_list b/dictsource/ga_list index c1e3da64..e67f39c9 100644 --- a/dictsource/ga_list +++ b/dictsource/ga_list @@ -37,11 +37,12 @@ y waI z zEd _á eI||f0d[@ _é i:||f0d[@ +_í aI||f0d[@ _ó o:||f0d[@ _ú ju:||f0d[@ _#32 spA:s - +_cap m'o:r // accent names diff --git a/dictsource/hu_rules b/dictsource/hu_rules index 3641678c..22e2c8b8 100644 --- a/dictsource/hu_rules +++ b/dictsource/hu_rules @@ -462,6 +462,7 @@ shetlan) d (szige d vé) d (jeggy d své) d (zseb d csalá) d (szer d + szaba) d (sajt d .group dz fogó) dz (kod ts @@ -820,12 +821,12 @@ _megsz) í (vatta i szabad) ítsz its: sz) í (vemészt i: vesz) ítsz i:ts: -progressz) í (ve i: -sz) í (vemel i: -sz) í (vere i: -sz) í (veré i: -sz) í (verő i: -sz) í (vevő i: +progressz) í (ve i: + sz) í (vemel i: + sz) í (vere i: + sz) í (veré i: + sz) í (verő i: + sz) í (vevő i: .group j j j @@ -1177,7 +1178,8 @@ _tetszé) s S kolbászo) s S feldolgozá) s S _ki) s (szín S -kérdé) s S + kérdé) s S + végzé) s S .group ss ssz ss2 @@ -1713,7 +1715,7 @@ szállodá) ssz Ss visszaélé) ssz Ss esé) ssz (erű Ss webe) ssz Ss -beleve) ssz (en s: +beleve) ssz (en s: .group sz diff --git a/dictsource/nl_list b/dictsource/nl_list index 26c5dfa1..9c2428dd 100644 --- a/dictsource/nl_list +++ b/dictsource/nl_list @@ -1544,6 +1544,10 @@ spektakel $2 tegennatuur $4 travestie $3 verderop $3 +verre vEr@ +verrekijker vEr@kEIk@r +verste vErst@ +verte vErt@ volledig $2 vrouwengek $alt3 waarschijnlijk $2 diff --git a/dictsource/nl_rules b/dictsource/nl_rules index 075bff33..917b7373 100644 --- a/dictsource/nl_rules +++ b/dictsource/nl_rules @@ -258,6 +258,7 @@ nd) es (_S1 s rd) es (_S1 s gt) es (_S1 s + wt) es (_S1 s es (ie_ e:z @) essen (_S5qd 'Es@n @) eres (_S4qd @r'Es @@ -738,8 +739,8 @@ _) inn (@P2 'I // ?? inneren u (x 8 uu y ui Wy - uw yU - uw (_ yU + uw (A yw + uw (K yU _) uit (@P3 'Wyt uul (_ 'yl // from -ule @@ -759,6 +760,7 @@ _) inn (@P2 'I // ?? inneren _) ver (@P3 v@r _) ver (sie_ vEr _) verder vErd@r + _) verge (@P5 vErg@ _) verge (le v@rQ'e: _) voort (@P5 v'O:rt diff --git a/docs/commands.html b/docs/commands.html index 92eaab00..fcf46181 100644 --- a/docs/commands.html +++ b/docs/commands.html @@ -29,22 +29,12 @@ Some Linux distrubitions (eg. SuSe 10) have version 19 of PortAudio which has a The speak program may be compiled without using PortAudio, by removing the line
   #define USE_PORTAUDIO
 
in the file speech.h.

 


-

2.1.2 Use with KDE Text-to-Speech (KTTS)

-To add to KDE-Text-to-Speech Manager (KTTSMgr), use it as a "Command" talker -with "command for speaking texts" set to:
- cat %f | espeak --stdin -w %w -v en -s190 -

-In this example, "en" is the voice name, "190" is the speed. -

-Note: -

-

 


-

2.1.3 Windows

-The installer: setup_espeak.exe installs the SAPI5 version of eSpeak. It also installs a command line program espeak in the espeak directory. +

2.1.2 Windows

+The installer: setup_espeak.exe installs the SAPI5 version of eSpeak. +During installation you need to specify which voices you want to appear in SAPI5 voice menus. +

+It also installs a command line program espeak in the espeak program directory.

 


2.2 COMMAND OPTIONS

@@ -176,7 +166,13 @@ The same as --compile, but source line numbers from the *_rules

--ipa
-Writes phonemes to stdout, using the International Phonetic Alphabet (IPA). +Writes phonemes to stdout, using the International Phonetic Alphabet (IPA).
+If a phoneme name contains more than one letter (eg. [tS]) an optional parameter can be used to distinguish +this from separate phonemes. +
+--pho=1 Use a tie character (U+0361) before subsequence letters. +
+--pho=2 Use a zero-width-joiner (U+200D) before subsequent letters.

--path [="<directory path>"]
diff --git a/docs/dictionary.html b/docs/dictionary.html index c3a58521..0ef87afe 100644 --- a/docs/dictionary.html +++ b/docs/dictionary.html @@ -311,6 +311,10 @@ S<number> may be followed by additonal letters (eg. S2ei ). Some of these f the suffix means the next word is likely to be a verb. + + m + after this suffix has been removed, additional suffixes may be removed. + diff --git a/docs/docindex.html b/docs/docindex.html index f0180864..5ec6713c 100644 --- a/docs/docindex.html +++ b/docs/docindex.html @@ -46,7 +46,7 @@ The list of phoneme mnemonics for English, for use in the Pronunciation Dictiona The tables of the phonemes used by each language, with their properties and sound production.

Intonation

Different intonation "tunes" may be defined for different languages for clauses which end in full-stop, comma, question-mark, and exclamation-mark. -

eSpeak Libary API

+

eSpeak Library API

API definition and header file for a shared library version of eSpeak.

Markup tags

SSML (Speech Synthesis Markup Language) and HTML tags recognized by eSpeak. diff --git a/docs/voices.html b/docs/voices.html index b4d166d7..3bcd8c0f 100644 --- a/docs/voices.html +++ b/docs/voices.html @@ -17,6 +17,11 @@ The available voice files can be listed by:
    espeak --voices
 or
    espeak --voices=<language>
+also +
   espeak --voices=<variant>
+Lists voice variants which can be applied to eSpeak voices. +
   espeak --voices=<mbrola>
+Lists the Mbrola voices.

5.2 Contents of Voice Files

The language attribute is mandatory. All the other attributes are optional. @@ -141,6 +146,11 @@ don't have their own tone statement.
These values give bandwidths of the noise peaks of the breath attribute. If breathw values are not given, then suitable default values will be used.

+

+speed  <value>
+
Default value 100.
+ Adjusts the speaking speed by a percentage of the default rate. This can be used if a language voice seems faster or slower compared to other voices. +

Language Attributes

@@ -229,6 +239,22 @@ See dictionary.html. The ISO 8859 character set number. (not all are implemented).

+

+dictmin  <value>
+
+ Used for some languages to detect if additional language data is installed. + If the size of the compiled dictionary data for the language (the file espeak-data/*_dict) is less than + this size then a warning is given. +

+

+alphabet2  <alphabet> <language>
+
+Used to specify a language to be used to speak words which are written in a non-native alphabet. eg: +
 alphabet2 cyr ru
+
+Alphabets names include: latin, cyr (cyrillic), ar (arabic). The default language for latin alphabet is English. +
+

Additional attributes are available to set various internal options which control how language is processed. These would normally be set in the program code rather than in a voice file.


@@ -240,7 +266,7 @@ speak command.
default
-
This voice is used if none is specified in the speak command. Copy your preferred voice to "default" so you can use the speak command without the need to specify a voice.
+
This voice is used if none is specified in the speak command. You can copy your preferred voice to "default" so you can use the speak command without the need to specify a voice.
For a list of voices provided for English and other languages see Languages. diff --git a/phsource/ph_english b/phsource/ph_english index d6f0ccd5..f0e54f71 100644 --- a/phsource/ph_english +++ b/phsource/ph_english @@ -145,10 +145,7 @@ phoneme @2 // Schwa, changes to I before a vowel IF nextPh(isVowel) THEN ChangePhoneme(I2) ENDIF - IF nextPh(isVowel) THEN - FMT(vowel/ii_4) - ENDIF - FMT(vowel/@) + ChangePhoneme(@) endphoneme @@ -159,7 +156,7 @@ phoneme @5 // Schwa, changes to U before a vowel IF nextPh(isVowel) OR nextPh(isPause) THEN ChangePhoneme(U) ENDIF - FMT(vowel/@) + ChangePhoneme(@) endphoneme diff --git a/phsource/ph_english_sc b/phsource/ph_english_sc index a4637e41..c3d04e8c 100644 --- a/phsource/ph_english_sc +++ b/phsource/ph_english_sc @@ -36,7 +36,7 @@ phoneme @2 // Schwa, changes to I before a vowel IF nextPh(isVowel) THEN ChangePhoneme(I2) ENDIF - FMT(vowel/@_3) + ChangePhoneme(@) endphoneme @@ -47,7 +47,7 @@ phoneme @5 // Schwa, changes to U before a vowel IF nextPh(isVowel) OR nextPh(isPause) THEN ChangePhoneme(U) ENDIF - FMT(vowel/@_3) + ChangePhoneme(@) endphoneme diff --git a/phsource/ph_german b/phsource/ph_german index 1e1e1b73..8699b23e 100644 --- a/phsource/ph_german +++ b/phsource/ph_german @@ -342,12 +342,12 @@ endphoneme -phoneme iR +phoneme iR // TEST "vier" = [f'iR] not successful vowel starttype #i endtype #@ ipa iɐ flag1 - length 180 - FMT(vdiph2/i@_2) + length 230 + FMT(vdiph2/i@_3) endphoneme diff --git a/phsource/ph_irish b/phsource/ph_irish index f1fcca86..a7d0eb3c 100644 --- a/phsource/ph_irish +++ b/phsource/ph_irish @@ -6,17 +6,17 @@ phoneme @ // Schwa, but always unstressed vowel starttype #@ endtype #@ unstressed - length 100 + length 110 IF nextPh(i:) THEN - Length 70 + Length 80 FMT(vwl_af/r@) ENDIF IF nextPh(I) THEN - Length 70 + Length 80 FMT(vwl_af/r@) ENDIF IF nextPh(e:) THEN - Length 70 + Length 80 FMT(vwl_af/r@) ENDIF FMT(vwl_af/@) @@ -25,14 +25,14 @@ endphoneme phoneme @/ vowel starttype #@ endtype #@ - length 120 + length 130 FMT(vowel/@) endphoneme phoneme a vowel starttype #a endtype #a - length 150 + length 165 FMT(vowel/a_4) endphoneme @@ -40,7 +40,7 @@ endphoneme phoneme a# vowel starttype #@ endtype #@ ipa ɐ - length 120 + length 130 ChangeIfStressed(a) FMT(vowel/a#_3) endphoneme @@ -48,13 +48,13 @@ endphoneme phoneme E vowel starttype #e endtype #e - length 140 + length 155 FMT(vowel/e_mid) endphoneme phoneme E# vowel starttype #@ endtype #@ - length 120 + length 130 ChangeIfStressed(E) ChangePhoneme(@/) endphoneme @@ -62,27 +62,27 @@ endphoneme phoneme I vowel starttype #i endtype #i - length 120 + length 130 FMT(vowel/ii_2) endphoneme phoneme i // non syllabic i for end of words vowel starttype #i endtype #i ipa iU+032F - length 40 + length 45 FMT(vowel/ii_7) endphoneme phoneme O vowel starttype #a endtype #@ - length 140 + length 155 FMT(vowel/V_4) endphoneme phoneme O# vowel starttype #@ endtype #@ - length 120 + length 130 ChangeIfStressed(O) ChangePhoneme(a#) endphoneme @@ -90,13 +90,13 @@ endphoneme phoneme U vowel starttype #u endtype #u - length 140 + length 155 FMT(vowel/uu) endphoneme phoneme U# vowel starttype #@ endtype #@ - length 120 + length 130 ChangeIfStressed(U) ChangePhoneme(@/) endphoneme @@ -104,20 +104,20 @@ endphoneme phoneme u1 vowel starttype #u endtype #u ipa uU+0306 - length 50 + length 55 FMT(vowel/u) endphoneme phoneme 0 vowel starttype #a endtype #a - length 180 + length 195 ipa A FMT(vowel/aa_8) endphoneme phoneme 0# vowel starttype #@ endtype #@ - length 120 + length 130 ChangeIfStressed(0) ChangePhoneme(a#) endphoneme @@ -125,7 +125,7 @@ endphoneme phoneme o: vowel starttype #o endtype #o - length 190 + length 210 FMT(vowel/o) endphoneme @@ -134,21 +134,21 @@ endphoneme phoneme A: vowel starttype #a endtype #a - length 200 + length 220 FMT(vowel/aa_2) endphoneme phoneme e: vowel starttype #e endtype #e - length 210 + length 230 FMT(vowel/e) endphoneme phoneme i: vowel starttype #i endtype #i - length 210 + length 230 FMT(vowel/i) endphoneme @@ -157,7 +157,7 @@ endphoneme phoneme u: vowel starttype #u endtype #u - length 210 + length 230 FMT(vowel/u_bck) endphoneme @@ -167,44 +167,44 @@ endphoneme phoneme @U vowel starttype #@ endtype #u - length 240 + length 260 FMT(vdiph/@u_3) endphoneme phoneme i@ vowel starttype #i endtype #@ - length 240 + length 260 FMT(vdiph2/i@) endphoneme phoneme u@ vowel starttype #u endtype #@ - length 240 + length 260 FMT(vdiph2/u@) endphoneme phoneme aI vowel starttype #a endtype #i - length 250 + length 275 FMT(vdiph/ai) endphoneme phoneme aI# vowel starttype #@ endtype #@ - length 120 + length 130 ChangeIfStressed(aI) ChangePhoneme(a#) endphoneme phoneme aU vowel starttype #a endtype #u - length 270 + length 300 FMT(vdiph/au_4) endphoneme phoneme aU# vowel starttype #@ endtype #@ - length 120 + length 130 ChangeIfStressed(aU) FMT(vdiph/au_4) endphoneme @@ -237,3 +237,7 @@ phoneme ; // linking j, used between (i) vowels and a following vowel ENDIF endphoneme + +phoneme eI + import_phoneme en/eI +endphoneme diff --git a/phsource/vdiph2/i@_3 b/phsource/vdiph2/i@_3 index 32266d60..f2b7531a 100644 Binary files a/phsource/vdiph2/i@_3 and b/phsource/vdiph2/i@_3 differ diff --git a/platforms/windows/make_espeak.iss b/platforms/windows/make_espeak.iss index 439e913b..2a83b5fa 100644 --- a/platforms/windows/make_espeak.iss +++ b/platforms/windows/make_espeak.iss @@ -2,7 +2,7 @@ [Setup] AppName=eSpeak -AppVerName=eSpeak version 1.47.01 +AppVerName=eSpeak version 1.47.03 AppCopyright=Licensed under GNU General Public License version 3. (See file License.txt for details). WindowVisible=yes diff --git a/platforms/windows/make_espeakedit.iss b/platforms/windows/make_espeakedit.iss index ffbebf1c..bafbdf3e 100644 --- a/platforms/windows/make_espeakedit.iss +++ b/platforms/windows/make_espeakedit.iss @@ -1,7 +1,7 @@ [Setup] AppName=eSpeakEdit -AppVerName=eSpeakEdit version 1.47.01 +AppVerName=eSpeakEdit version 1.47.03 DefaultDirName={pf}\eSpeak DefaultGroupName=eSpeak OutputBaseFilename=setup_espeakedit @@ -32,18 +32,24 @@ Source: "License.txt"; DestDir: "{app}"; [Languages] Name: "en"; MessagesFile: "compiler:Default.isl" Name: "af"; MessagesFile: "compiler:Languages\Afrikaans.isl" +Name: "bg"; MessagesFile: "compiler:Languages\Bulgarian.isl" Name: "bs"; MessagesFile: "compiler:Languages\Bosnian.isl" Name: "cs"; MessagesFile: "compiler:Languages\Czech.isl" +Name: "da"; MessagesFile: "compiler:Languages\Danish.isl" Name: "de"; MessagesFile: "compiler:Languages\German.isl" Name: "el"; MessagesFile: "compiler:Languages\Greek.isl" Name: "es"; MessagesFile: "compiler:Languages\Spanish.isl" +Name: "fa"; MessagesFile: "compiler:Languages\Farsi.isl" Name: "fi"; MessagesFile: "compiler:Languages\Finnish.isl" Name: "fr"; MessagesFile: "compiler:Languages\French.isl" +Name: "hi"; MessagesFile: "compiler:Languages\Hindi.islu" Name: "hr"; MessagesFile: "compiler:Languages\Croatian.isl" Name: "hu"; MessagesFile: "compiler:Languages\Hungarian.isl" Name: "id"; MessagesFile: "compiler:Languages\Indonesian-5.1.11.isl" Name: "it"; MessagesFile: "compiler:Languages\Italian.isl" -Name: "lv"; MessagesFile: "compiler:Languages\Latvian-1-5.1.11.isl" +Name: "ka"; MessagesFile: "compiler:Languages\Georgian.islu" +Name: "lv"; MessagesFile: "compiler:Languages\Latvian.isl" +Name: "ne"; MessagesFile: "compiler:Languages\Nepali.islu" Name: "nl"; MessagesFile: "compiler:Languages\Dutch.isl" Name: "no"; MessagesFile: "compiler:Languages\Norwegian.isl" Name: "pl"; MessagesFile: "compiler:Languages\Polish.isl" @@ -51,8 +57,8 @@ Name: "pt"; MessagesFile: "compiler:Languages\Portuguese.isl" Name: "ro"; MessagesFile: "compiler:Languages\Romanian.isl" Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl" Name: "sk"; MessagesFile: "compiler:Languages\Slovak.isl" -;Name: "sq"; MessagesFile: "compiler:Languages\Albanian-2-5.1.11.isl" Name: "sr"; MessagesFile: "compiler:Languages\Serbian.isl" Name: "tr"; MessagesFile: "compiler:Languages\Turkish.isl" +Name: "vi"; MessagesFile: "compiler:Languages\Vietnamese.isl" Name: "zh"; MessagesFile: "compiler:Languages\ChineseSimp-12-5.1.11.isl" diff --git a/src/dictionary.cpp b/src/dictionary.cpp index 1af05357..3d2e37ce 100644 --- a/src/dictionary.cpp +++ b/src/dictionary.cpp @@ -2694,7 +2694,7 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c { if(tr->langopts.alt_alphabet == alphabet->offset) { - sprintf(phonemes,"%c%s",phonSWITCH, tr->langopts.alt_alphabet_lang); + sprintf(phonemes,"%c%s",phonSWITCH, WordToString2(tr->langopts.alt_alphabet_lang)); return(0); } if(alphabet->flags & AL_WORDS) @@ -2984,6 +2984,7 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor const char *word_end; const char *word1; int wflags = 0; + int lookup_symbol; char word_buf[N_WORD_BYTES+1]; char dict_flags_buf[80]; @@ -2992,6 +2993,7 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor wflags = wtab->flags; } + lookup_symbol = flags[1] & FLAG_LOOKUP_SYMBOL; word1 = word; if(tr->transpose_min > 0) { @@ -3178,9 +3180,9 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor continue; } - if((dictionary_flags2 & FLAG_ATEND) && (word_end < translator->clause_end)) + if((dictionary_flags2 & FLAG_ATEND) && (word_end < translator->clause_end) && (lookup_symbol==0)) { - // only use this pronunciation if it's the last word of the clause + // only use this pronunciation if it's the last word of the clause, or called from Lookup() continue; } @@ -3192,7 +3194,7 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor if((dictionary_flags2 & FLAG_SENTENCE) && !(translator->clause_terminator & CLAUSE_BIT_SENTENCE)) { - // only uis this clause is a sentence , i.e. terminator is {. ? !} not {, : :} + // only if this clause is a sentence , i.e. terminator is {. ? !} not {, : :} continue; } @@ -3471,7 +3473,8 @@ int LookupDictList(Translator *tr, char **wordptr, char *ph_out, unsigned int *f int Lookup(Translator *tr, const char *word, char *ph_out) {//=================================================== unsigned int flags[2]; - flags[0] = flags[1] = 0; + flags[0] = 0; + flags[1] = FLAG_LOOKUP_SYMBOL; char *word1 = (char *)word; return(LookupDictList(tr, &word1, ph_out, flags, 0, NULL)); } diff --git a/src/numbers.cpp b/src/numbers.cpp index d9708805..0ecff92f 100644 --- a/src/numbers.cpp +++ b/src/numbers.cpp @@ -691,6 +691,9 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control) if(ph_buf[0] == 0) { + if(al_offset == translator->langopts.alt_alphabet) + language = translator->langopts.alt_alphabet_lang; + else if((alphabet != NULL) && (alphabet->language != 0) && !(al_flags & AL_NOT_LETTERS)) language = alphabet->language; else @@ -793,7 +796,7 @@ int TranslateLetter(Translator *tr, char *word, char *phonemes, int control) len = strlen(phonemes); - if(tr->langopts.accents & 2) + if(tr->langopts.accents & 2) // 'capital' before or after the word ? sprintf(ph_buf2,"%c%s%s%s",0xff,ph_alphabet,ph_buf,capital); else sprintf(ph_buf2,"%c%s%s%s",0xff,ph_alphabet,capital,ph_buf); // the 0xff marker will be removed or replaced in SetSpellingStress() diff --git a/src/speak.cpp b/src/speak.cpp index 7ce8e70a..559d7d18 100644 --- a/src/speak.cpp +++ b/src/speak.cpp @@ -750,11 +750,22 @@ int main (int argc, char **argv) init_path(argv[0],data_path); initialise(); + if(voicename[0] == 0) + strcpy(voicename,"default"); + + if(SetVoiceByName(voicename) != EE_OK) + { + memset(&voice_select,0,sizeof(voice_select)); + voice_select.languages = voicename; + if(SetVoiceByProperties(&voice_select) != EE_OK) + { + fprintf(stderr,"%svoice '%s'\n",err_load,voicename); + exit(2); + } + } if(flag_compile) { - LoadVoice(voicename,5); - #ifdef PLATFORM_DOS char path_dsource[sizeof(path_home)+20]; strcpy(path_dsource,path_home); @@ -776,20 +787,6 @@ int main (int argc, char **argv) } - if(voicename[0] == 0) - strcpy(voicename,"default"); - - if(SetVoiceByName(voicename) != EE_OK) - { - memset(&voice_select,0,sizeof(voice_select)); - voice_select.languages = voicename; - if(SetVoiceByProperties(&voice_select) != EE_OK) - { - fprintf(stderr,"%svoice '%s'\n",err_load,voicename); - exit(2); - } - } - SetParameter(espeakRATE,speed,0); SetParameter(espeakVOLUME,amp,0); SetParameter(espeakCAPITALS,option_capitals,0); diff --git a/src/synthdata.cpp b/src/synthdata.cpp index 77bf2eca..99f02651 100644 --- a/src/synthdata.cpp +++ b/src/synthdata.cpp @@ -35,7 +35,7 @@ #include "translate.h" #include "wave.h" -const char *version_string = "1.47.02 19.Mar.13"; +const char *version_string = "1.47.03 21.Mar.13"; const int version_phdata = 0x014701; int option_device_number = -1; diff --git a/src/tr_languages.cpp b/src/tr_languages.cpp index 2f29bdc7..8cea390e 100644 --- a/src/tr_languages.cpp +++ b/src/tr_languages.cpp @@ -103,6 +103,19 @@ ALPHABET alphabets [] = { }; +ALPHABET *AlphabetFromName(const char *name) +{//========================================== + ALPHABET *alphabet; + + for(alphabet=alphabets; alphabet->name != NULL; alphabet++) + { + if(strcmp(name, &alphabet->name[1]) == 0) + return(alphabet); + } + return(NULL); +} + + ALPHABET *AlphabetFromChar(int c) {//=============================== // Find the alphabet from a character. @@ -276,7 +289,7 @@ static const char transpose_map_latin[] = { tr->langopts.param2[LOPT_BRACKET_PAUSE] = 2; // pauses when announcing bracket names tr->langopts.max_initial_consonants = 3; tr->langopts.replace_chars = NULL; - tr->langopts.ascii_language = ""; // Non-Latin alphabet languages, use this language to speak Latin words, default is English + tr->langopts.ascii_language[0] = 0; // Non-Latin alphabet languages, use this language to speak Latin words, default is English SetLengthMods(tr,201); @@ -828,6 +841,7 @@ Translator *SelectTranslator(const char *name) { tr->langopts.stress_rule = STRESSPOSN_1L; tr->langopts.numbers = 1; + tr->langopts.accents = 2; // 'capital' after letter name } break; @@ -1054,7 +1068,7 @@ SetLengthMods(tr,3); // all equal tr->langopts.numbers = NUM_VIGESIMAL | NUM_AND_UNITS | NUM_OMIT_1_HUNDRED |NUM_OMIT_1_THOUSAND | NUM_DFRACTION_5 | NUM_ROMAN; tr->langopts.alt_alphabet = OFFSET_CYRILLIC; - tr->langopts.alt_alphabet_lang = "ru"; + tr->langopts.alt_alphabet_lang = L('r','u'); } break; diff --git a/src/translate.h b/src/translate.h index e7460443..98228d30 100644 --- a/src/translate.h +++ b/src/translate.h @@ -83,6 +83,7 @@ #define FLAG_STEM 0x10000 // must have a suffix #define FLAG_ATEND 0x20000 /* use this pronunciation if at end of clause */ #define FLAG_ATSTART 0x40000 // use this pronunciation if at start of clause +#define FLAG_LOOKUP_SYMBOL 0x40000000 // to indicate called from Lookup() #define BITNUM_FLAG_ALLCAPS 0x2a #define BITNUM_FLAG_HYPHENATED 0x2c @@ -542,9 +543,9 @@ typedef struct { int testing; // testing options: bit 1= specify stressed syllable in the form: "outdoor/2" int listx; // compile *_listx after *list const unsigned int *replace_chars; // characters to be substitutes - const char *ascii_language; // switch to this language for Latin characters + char ascii_language[8]; // switch to this language for Latin characters int alt_alphabet; // offset for another language to recognize - const char *alt_alphabet_lang; // language for the alt_alphabet + int alt_alphabet_lang; // language for the alt_alphabet int max_lengthmod; int lengthen_tonic; // lengthen the tonic syllable int suffix_add_e; // replace a suffix (which has the SUFX_E flag) with this character @@ -713,6 +714,7 @@ int towlower2(unsigned int c); void GetTranslatedPhonemeString(char *phon_out, int n_phon_out, int use_ipa); const char *WordToString2(unsigned int word); ALPHABET *AlphabetFromChar(int c); +ALPHABET *AlphabetFromName(const char *name); Translator *SelectTranslator(const char *name); int SetTranslator2(const char *name); diff --git a/src/voices.cpp b/src/voices.cpp index 26eb44c5..8fa66944 100644 --- a/src/voices.cpp +++ b/src/voices.cpp @@ -109,6 +109,7 @@ enum { V_FAST, V_SPEED, V_DICTMIN, + V_ALPHABET2, // these need a phoneme table to have been specified V_REPLACE, @@ -160,6 +161,7 @@ static MNEM_TAB keyword_tab[] = { {"fast_test2", V_FAST}, {"speed", V_SPEED}, {"dict_min", V_DICTMIN}, + {"alphabet2", V_ALPHABET2}, // these just set a value in langopts.param[] {"l_dieresis", 0x100+LOPT_DIERESES}, @@ -530,6 +532,21 @@ static int Read8Numbers(char *data_in,int *data) } +static unsigned int StringToWord2(const char *string) +{//====================================================== +// Convert a language name string to a word such as L('e','n') + int ix; + int c; + unsigned int value = 0; + + for(ix=0; (ix<4) & ((c = string[ix]) != 0); ix++) + { + value = (value << 8) | (c & 0xff); + } + return(value); +} + + voice_t *LoadVoice(const char *vname, int control) {//=============================================== // control, bit 0 1= no_default @@ -571,6 +588,7 @@ voice_t *LoadVoice(const char *vname, int control) int stress_lengths[8]; int stress_add[8]; char names[8][40]; + char name1[40]; char name2[80]; const char *voice_dir; @@ -581,11 +599,11 @@ voice_t *LoadVoice(const char *vname, int control) static char voice_name[40]; // voice name for current_voice_selected static char voice_languages[100]; // list of languages and priorities for current_voice_selected - // which directory to look for a named voice + // which directory to look for a named voice. List of voice names, must end in a space. static const char *voices_asia = "fa fa-pin hi hy hy-west id ka kn ku ml ne pa ta tr vi vi-hue zh zh-yue "; static const char *voices_europe = - "an bg bs ca cs cy da el es et fi fr-be hr hu is it lt lv mk nl no pl pt-pt ro ru sk sq sr sv "; + "an bg bs ca cs cy da el es et fi fr-be ga hr hu is it lt lv mk nl no pl pt-pt ro ru sk sq sr sv "; strncpy0(voicename, vname, sizeof(voicename)); @@ -960,12 +978,10 @@ voice_t *LoadVoice(const char *vname, int control) case V_MBROLA: { int srate = 16000; - char name[40]; - char phtrans[40]; - phtrans[0] = 0; - sscanf(p,"%s %s %d",name,phtrans,&srate); - if(LoadMbrolaTable(name,phtrans,srate) != EE_OK) + name2[0] = 0; + sscanf(p,"%s %s %d",name1,name2,&srate); + if(LoadMbrolaTable(name1,name2,srate) != EE_OK) { fprintf(stderr,"mbrola voice not found\n"); } @@ -988,6 +1004,28 @@ voice_t *LoadVoice(const char *vname, int control) sscanf(p,"%d",&dict_min); break; + case V_ALPHABET2: + { + ALPHABET *alphabet; + name1[0] = name2[0] = 0; + sscanf(p, "%s %s", name1, name2); + + if(strcmp(name1, "latin") == 0) + { + strncpy0(langopts->ascii_language,name2,sizeof(langopts->ascii_language)); + } + else if((alphabet = AlphabetFromName(name1)) != 0) + { + langopts->alt_alphabet = alphabet->offset; + langopts->alt_alphabet_lang = StringToWord2(name2); + } + else + { + fprintf(stderr,"alphabet name '%s' not found\n", name1); + } + } + break; + default: if((key & 0xff00) == 0x100) {