lang=vi: recognise combining accent characters (for tone accents). Use a different intonation pattern, with more expression, for sentences which end in exclamation mark. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@112 d46cf337-b52f-0410-862d-fd96e6ae7743master
| //maintainer: Willem van der Walt | |||||
| //maintainer: Willem van der Walt | |||||
| // email: [email protected] | // email: [email protected] | ||||
| // tel: +27 12 8413996 | // tel: +27 12 8413996 | ||||
| // Meraka Institute, CSIR | // Meraka Institute, CSIR | ||||
| // Place names | // Place names | ||||
| alaska al'aska | |||||
| asië A:si@ | asië A:si@ | ||||
| babilon babilOn | |||||
| bangladesh baNglad'ES | bangladesh baNglad'ES | ||||
| bastille bast'il | |||||
| bethlehem bEt_liEm | bethlehem bEt_liEm | ||||
| boekarest bukarEst | boekarest bukarEst | ||||
| bonnievale _^_EN | |||||
| brittanje $2 | brittanje $2 | ||||
| caledon kalidOn | caledon kalidOn | ||||
| carolina karul'ina | |||||
| ceres se@r@s | |||||
| ceylon s@lOn | ceylon s@lOn | ||||
| china S'ina | china S'ina | ||||
| franschhoek frA~nsh'uk | |||||
| gadara x2@dA:ra | |||||
| galilea x2al@l'i:a | galilea x2al@l'i:a | ||||
| gariep x2ar'ip | |||||
| getsémané x2Ets'e@mani | |||||
| goudini $2 | |||||
| (graaff reinet) x2rA:f||r@n'Et | (graaff reinet) x2rA:f||r@n'Et | ||||
| griekeland x2rik@lant | griekeland x2rik@lant | ||||
| hermon $1 | |||||
| hirosjima hiruS'ima | |||||
| israel IsraI:l | israel IsraI:l | ||||
| italië it'A:li;@ | italië it'A:li;@ | ||||
| jerusalem j@r'ysalEm | |||||
| kanada kanad%a | kanada kanad%a | ||||
| kanaän kA:nA:an | kanaän kA:nA:an | ||||
| kenia ki:nia | kenia ki:nia | ||||
| turkye $2 | turkye $2 | ||||
| upington apiNt@n | upington apiNt@n | ||||
| vesuvius v@su:viWs | vesuvius v@su:viWs | ||||
| wellington wEliNt@n | |||||
| worcester v'ust@r | worcester v'ust@r | ||||
| zimbabwe zI:mb'ab_wE | zimbabwe zI:mb'ab_wE | ||||
| // People names | // People names | ||||
| Abiméleg abin'e@lEx2 | Abiméleg abin'e@lEx2 | ||||
| abraham A:bram | abraham A:bram | ||||
| ackerman ak@rman | |||||
| adrie A:dri | adrie A:dri | ||||
| aletta al'Eta | |||||
| alida al'ida | alida al'ida | ||||
| allah %alA: | allah %alA: | ||||
| André 'andreI | André 'andreI | ||||
| antoinette antun'Et | antoinette antun'Et | ||||
| benjamin bEndZ@m@n | benjamin bEndZ@m@n | ||||
| bester b'Est@r | bester b'Est@r | ||||
| beyers beI@rs | |||||
| blomerus blum'e@rWs | blomerus blum'e@rWs | ||||
| botha bo@ta | botha bo@ta | ||||
| bouwer b@U@r | bouwer b@U@r | ||||
| breytenbach breIt@nbax2 | breytenbach breIt@nbax2 | ||||
| brouwer bruw'&:r | |||||
| caesar siz@r | |||||
| carl kA:r@L | carl kA:r@L | ||||
| cecilia s@si:lia | cecilia s@si:lia | ||||
| charl SA:l | charl SA:l | ||||
| charles _^_EN | charles _^_EN | ||||
| charlie tSA:li | charlie tSA:li | ||||
| chopin S%OpA~ | chopin S%OpA~ | ||||
| conradie $2 | |||||
| chris krIs | chris krIs | ||||
| christo krIstu | christo krIstu | ||||
| christoffel kr@stOf@l | |||||
| christian krIstian | christian krIstian | ||||
| christelle kr@st&l | christelle kr@st&l | ||||
| christine kr@st'i:n | christine kr@st'i:n | ||||
| elisabeth il'isabEt | elisabeth il'isabEt | ||||
| elize il'i:z | elize il'i:z | ||||
| elsabé &ls@bi | elsabé &ls@bi | ||||
| emmarentia Emar'e~nSja | |||||
| eségiël is'e@x2i_@l | eségiël is'e@x2i_@l | ||||
| estelle %ist&l | estelle %ist&l | ||||
| etienne Eti@n | etienne Eti@n | ||||
| gabriël x2A:bri@l | gabriël x2A:bri@l | ||||
| george _^_EN | george _^_EN | ||||
| gerhard x2&rart | gerhard x2&rart | ||||
| gerhardus $2 | |||||
| gloria glO:ria | gloria glO:ria | ||||
| gouws x2@Us | gouws x2@Us | ||||
| grange x2rA:nsi | grange x2rA:nsi | ||||
| havenga hA:f@Nx2a | havenga hA:f@Nx2a | ||||
| haydn hAId@n | haydn hAId@n | ||||
| helena hil'e@na | helena hil'e@na | ||||
| helloïse hEluw'i:z | |||||
| herklaas $1 | herklaas $1 | ||||
| herman $1 | herman $1 | ||||
| hilde hild@ | hilde hild@ | ||||
| naomi na_'o@mi | naomi na_'o@mi | ||||
| natasha n%at'aSa | natasha n%at'aSa | ||||
| naudé nOd'e@ | naudé nOd'e@ | ||||
| neil _^_EN | |||||
| philip fIl@p | philip fIl@p | ||||
| phillips fIl@ps | phillips fIl@ps | ||||
| pierre p'e@r | pierre p'e@r | ||||
| rousseau r@s@U | rousseau r@s@U | ||||
| roux r'u | roux r'u | ||||
| salomo sA:l@mo@ | salomo sA:l@mo@ | ||||
| sandra sandra | |||||
| schalk sk'alk | schalk sk'alk | ||||
| scheepers ske@p@rs | scheepers ske@p@rs | ||||
| schmidt Smit | schmidt Smit | ||||
| violet _^_EN $capital | violet _^_EN $capital | ||||
| william _^_EN | william _^_EN | ||||
| yolande jul'and@ | yolande jul'and@ | ||||
| yvonne iv'On | |||||
| zyl seIl | zyl seIl | ||||
| marais mar'E: | marais mar'E: | ||||
| mandela mand'E:la | mandela mand'E:la | ||||
| aanstaande $2 | aanstaande $2 | ||||
| adagio ad'A:dZi;%@U | adagio ad'A:dZi;%@U | ||||
| afkere afke@r@ | afkere afke@r@ | ||||
| agamemnon ax2am'EmnOn | |||||
| agterstevoor $4 | agterstevoor $4 | ||||
| agterweë $3 | agterweë $3 | ||||
| algaande $2 | algaande $2 | ||||
| algehele alx2@h,e@l@ | algehele alx2@h,e@l@ | ||||
| allegro al'Egru | |||||
| alles al@s | alles al@s | ||||
| almiskie $3 | |||||
| alom al_'Om | alom al_'Om | ||||
| alreeds $2 | alreeds $2 | ||||
| alternatiewe $4 | alternatiewe $4 | ||||
| amen A:mEn | amen A:mEn | ||||
| anatomie $4 | |||||
| anale an'A:l@ | |||||
| anatomie $4 $only | |||||
| asof asOf | asof asOf | ||||
| asook %as_o@k | asook %as_o@k | ||||
| aspris $2 | aspris $2 | ||||
| attraksie $2 | attraksie $2 | ||||
| babelaas bab@lA:s | babelaas bab@lA:s | ||||
| barrikade $3 | |||||
| beide beId@ | beide beId@ | ||||
| belangriker b@laNr@k,Ir | belangriker b@laNr@k,Ir | ||||
| belangrikst@ b@laNr@kst@ | belangrikst@ b@laNr@kst@ | ||||
| bêre b&:r@ | bêre b&:r@ | ||||
| beskryf b@skr'eIf | beskryf b@skr'eIf | ||||
| bestes bEst@s | bestes bEst@s | ||||
| beta be@ta | |||||
| bewe be@v@ | bewe be@v@ | ||||
| bewend be@v@nt | bewend be@v@nt | ||||
| bewering b@ve@rIN | bewering b@ve@rIN | ||||
| cabernet kab@rn'eI | cabernet kab@rn'eI | ||||
| camembert kam@mb'&:r | camembert kam@mb'&:r | ||||
| camouflage kamufl'A:Z | camouflage kamufl'A:Z | ||||
| charisma kar'Isma | |||||
| chemikalieë $3 | chemikalieë $3 | ||||
| dadelik dA:d@lIk | dadelik dA:d@lIk | ||||
| deurentyd dy@r@nteIt | deurentyd dy@r@nteIt | ||||
| deurgaans $1 | deurgaans $1 | ||||
| deurkruis $2 | deurkruis $2 | ||||
| deurstraalde $2 | |||||
| dikwels dIkv@ls | dikwels dIkv@ls | ||||
| diplomasie d@plo@mas'i | diplomasie d@plo@mas'i | ||||
| dusver dWsf&r | dusver dWsf&r | ||||
| eenkeer $1 | eenkeer $1 | ||||
| efesiër if'e@si@r | |||||
| effense Ef@ns@ | effense Ef@ns@ | ||||
| ekself %&ks'&lf | ekself %&ks'&lf | ||||
| ekstra Ekstra | ekstra Ekstra | ||||
| elders &ld@rs | elders &ld@rs | ||||
| elite il'i:t | elite il'i:t | ||||
| enige e@nIx2@ | enige e@nIx2@ | ||||
| eone $2 | |||||
| era e@ra | era e@ra | ||||
| erger &rg@r | erger &rg@r | ||||
| espeak i:;spi:k | espeak i:;spi:k | ||||
| (et cetera) Ets'Et@ra | |||||
| euro Y@ru | euro Y@ru | ||||
| exodus Eks'o@dWs | exodus Eks'o@dWs | ||||
| filippense f@l@pEns@ | filippense f@l@pEns@ | ||||
| finalis $3 | finalis $3 | ||||
| finaliste $3 | finaliste $3 | ||||
| fort fOrt | |||||
| forte fOrt@ | |||||
| frontaal $2 | frontaal $2 | ||||
| frontale $2 | frontale $2 | ||||
| gratis x2r'A:t@s | gratis x2r'A:t@s | ||||
| hallo h'Il,@U | hallo h'Il,@U | ||||
| hanteer $2 | |||||
| hanou hA:n@U | |||||
| hardop hart?Op | hardop hart?Op | ||||
| hasepad hA:s@pat | |||||
| heeltemal he@lt@mal | heeltemal he@lt@mal | ||||
| heengaan he@nx2A:n | |||||
| hek h&k | hek h&k | ||||
| hekke h&k@ | hekke h&k@ | ||||
| helaas he@l'A:s | helaas he@l'A:s | ||||
| here he@r@ | here he@r@ | ||||
| herero hEr'E:ru | |||||
| herrysenis h&r'eIs@n@s | herrysenis h&r'eIs@n@s | ||||
| hiernamaals hi:rn'A:mA:ls | hiernamaals hi:rn'A:mA:ls | ||||
| hierso hi:rsO | hierso hi:rsO | ||||
| hoewel huv'&l | hoewel huv'&l | ||||
| hokaai hOkAI | hokaai hOkAI | ||||
| hoofsaaklik $2 | hoofsaaklik $2 | ||||
| hosanna hus'ana | |||||
| ibis $1 | ibis $1 | ||||
| idee $2 | idee $2 | ||||
| idilles id'Il@s | |||||
| ignoreer ix2no@r'e@r | ignoreer ix2no@r'e@r | ||||
| inagneming @nax2ne@m@N | inagneming @nax2ne@m@N | ||||
| indien Indin $verb | indien Indin $verb | ||||
| inkatha iNk'A:ta | |||||
| inkluis $2 | inkluis $2 | ||||
| insomnia @nsOmnija | |||||
| intens @nt'Ens | intens @nt'Ens | ||||
| intensiteit $4 | intensiteit $4 | ||||
| jupiter jupit@r | jupiter jupit@r | ||||
| kafee kaf'e@ | kafee kaf'e@ | ||||
| katswink katsv@nk | |||||
| kaviaar kavi'A:r | kaviaar kavi'A:r | ||||
| klaasvakie $2 | |||||
| knapsekêrel knaps@k&:r@l | |||||
| komaan kOmA:n | komaan kOmA:n | ||||
| konkawe kOnk'A:v@ | |||||
| kopiereg kup'ir&x2 | kopiereg kup'ir&x2 | ||||
| korswel kOrsv@l | |||||
| kotiljons kOt@lj'o~ns | |||||
| kritiek krIt'ik | kritiek krIt'ik | ||||
| kulture $2 | kulture $2 | ||||
| kunsmatige kWnsm'A:t@x2@ | kunsmatige kWnsm'A:t@x2@ | ||||
| kwansuis $2 | kwansuis $2 | ||||
| latere l'A:t@r@ | latere l'A:t@r@ | ||||
| lekker l&k@r | |||||
| lekkerder l&k@rd@r | lekkerder l&k@rd@r | ||||
| lekkerste l&k@rst@ | lekkerste l&k@rst@ | ||||
| netjies nE:icis | netjies nE:icis | ||||
| netjiese nEicis@ | netjiese nEicis@ | ||||
| netsowel nEtso@v&l | netsowel nEtso@v&l | ||||
| nietemin n'it@m@n | |||||
| nimmermeer $1 | nimmermeer $1 | ||||
| nobelprys $2 | nobelprys $2 | ||||
| normale nOrm'A:l@ | normale nOrm'A:l@ | ||||
| pinotage pinut'A:Z | pinotage pinut'A:Z | ||||
| pirouette p@ru:'Et | pirouette p@ru:'Et | ||||
| reeds re@ts | |||||
| rebelleer r@b@le@r | |||||
| retireer r@t@re@:r | retireer r@t@re@:r | ||||
| retoriek r@tur'ik | retoriek r@tur'ik | ||||
| rimpeling rImp@l@N | rimpeling rImp@l@N | ||||
| sover so@f&r | sover so@f&r | ||||
| spesmaas $2 | spesmaas $2 | ||||
| stabiel stab'il | stabiel stab'il | ||||
| staccato $2 | |||||
| terdeë $2 | terdeë $2 | ||||
| terug t@-rWx2 | terug t@-rWx2 | ||||
| toegee tux2e@ | toegee tux2e@ | ||||
| totale tut'A:l@ | totale tut'A:l@ | ||||
| totsiens $2 | totsiens $2 | ||||
| tragiek trax2'ik | |||||
| uitdaging YydA:x2@N | uitdaging YydA:x2@N | ||||
| uiteraard Yyt@r_'A:rt | uiteraard Yyt@r_'A:rt | ||||
| vererger f@r&rg@r | vererger f@r&rg@r | ||||
| ver f'&:r | ver f'&:r | ||||
| verg f&rx2 | verg f&rx2 | ||||
| vergeleë f&:rx2@l,e@@ | |||||
| vergete f@rx2e@t@ | vergete f@rx2e@t@ | ||||
| vermy $2 | vermy $2 | ||||
| verre f&:r@ | verre f&:r@ | ||||
| vertes f&rt@s | vertes f&rt@s | ||||
| via via | via via | ||||
| volheid $1 | volheid $1 | ||||
| volte $1 | |||||
| voluit fOl_Yyt | voluit fOl_Yyt | ||||
| voorgee fo@rx2e@ | voorgee fo@rx2e@ | ||||
| voorkeer $1 | voorkeer $1 |
| Dictionary vi_dict | Dictionary vi_dict | ||||
| @ @: @:I @:U @I @U a a: | |||||
| a:I a:U aI aU E e eU EU | |||||
| i i@ iU O o OI oI u | |||||
| u@ uI y y@ yI | |||||
| b c d D f g h j | |||||
| k kh l m n N n^ p | |||||
| Q s t t[ ts; tS; v w | |||||
| x z Z z; | |||||
| @: a a: a:I aI aU E e | |||||
| i o | |||||
| b d g h k m n p | |||||
| s t t[ ts; v w z | |||||
| Dictionary zhy_dict | Dictionary zhy_dict |
| api $abbrev | api $abbrev | ||||
| asap $abbrev | asap $abbrev | ||||
| awol eIw0l | awol eIw0l | ||||
| cia $abbrev | |||||
| cio $abbrev | cio $abbrev | ||||
| ctrl k0ntr'oUl | ctrl k0ntr'oUl | ||||
| dept dI2pA@tm@nt | dept dI2pA@tm@nt |
| // replace combining (tone) accents with single characters | |||||
| .replace | |||||
| à à | |||||
| á á | |||||
| ả ả | |||||
| ã ã | |||||
| ạ ạ | |||||
| ằ ằ | |||||
| ắ ắ | |||||
| ẳ ẳ | |||||
| ẵ ẵ | |||||
| ặ ặ | |||||
| ầ ầ | |||||
| ấ ấ | |||||
| ẩ ẩ | |||||
| ẫ ẫ | |||||
| ậ ậ | |||||
| è è | |||||
| é é | |||||
| ẻ ẻ | |||||
| ẽ ẽ | |||||
| ẹ ẹ | |||||
| ề ề | |||||
| ế ế | |||||
| ể ể | |||||
| ễ ễ | |||||
| ệ ệ | |||||
| ì ì | |||||
| í í | |||||
| ỉ ỉ | |||||
| ĩ ĩ | |||||
| ị ị | |||||
| ò ò | |||||
| ó ó | |||||
| ỏ ỏ | |||||
| õ õ | |||||
| ọ ọ | |||||
| ồ ồ | |||||
| ố ố | |||||
| ổ ổ | |||||
| ỗ ỗ | |||||
| ộ ộ | |||||
| ờ ờ | |||||
| ớ ớ | |||||
| ở ở | |||||
| ỡ ỡ | |||||
| ợ ợ | |||||
| ù ù | |||||
| ú ú | |||||
| ủ ủ | |||||
| ũ ũ | |||||
| ụ ụ | |||||
| ừ ừ | |||||
| ứ ứ | |||||
| ử ử | |||||
| ữ ữ | |||||
| ự ự | |||||
| ỳ ỳ | |||||
| ý ý | |||||
| ỷ ỷ | |||||
| ỹ ỹ | |||||
| ỵ ỵ | |||||
| .group a | .group a | ||||
| a a: | a a: | ||||
| ai a:I | ai a:I | ||||
| $ d'o||l'a | $ d'o||l'a | ||||
| % f'@2n||tS;'am | % f'@2n||tS;'am | ||||
| vdiph/@u_2 [oU] en_rp | vdiph/@u_2 [oU] en_rp | ||||
| vdiph/@u_3 [@U] ro | vdiph/@u_3 [@U] ro | ||||
| vdiph/@u_en [oU] en | vdiph/@u_en [oU] en | ||||
| [@U] vi | |||||
| [@:U] vi | |||||
| vdiph/ui [uI] base2 | vdiph/ui [uI] base2 | ||||
| [uI] en | [uI] en | ||||
| [uI] eo | [uI] eo | ||||
| vdiph/Vu [@U] af | vdiph/Vu [@U] af | ||||
| vdiph/Vu_2 [oU] en_wm | vdiph/Vu_2 [oU] en_wm | ||||
| vdiph/Vu_3 [o:] nl | vdiph/Vu_3 [o:] nl | ||||
| vdiph/Vu_4 [@U] vi | |||||
| [@:U] vi | |||||
| vdiph/&y [&y] fi | vdiph/&y [&y] fi | ||||
| [Wy] nl | [Wy] nl | ||||
| vdiph/yi [yi] fi | vdiph/yi [yi] fi | ||||
| [V#] ru | [V#] ru | ||||
| vowel/V_3 [V] en_rp | vowel/V_3 [V] en_rp | ||||
| [V] hi | [V] hi | ||||
| [@:] vi | |||||
| vowel/V_4 [V] en_sc | vowel/V_4 [V] en_sc | ||||
| [@:] vi | |||||
| vowel/V_6 [V] en_us | vowel/V_6 [V] en_us | ||||
| vowel/y [y:] en | vowel/y [y:] en | ||||
| [y:] de | [y:] de |
| phoneme a: | phoneme a: | ||||
| vowel starttype (a) endtype (a) | vowel starttype (a) endtype (a) | ||||
| length 260 | |||||
| length 280 | |||||
| formants vowel/a_2 | formants vowel/a_2 | ||||
| endphoneme | endphoneme | ||||
| phoneme @: | phoneme @: | ||||
| vowel starttype (@) endtype (@) | vowel starttype (@) endtype (@) | ||||
| length 260 | |||||
| formants vowel/V_3 | |||||
| length 280 | |||||
| formants vowel/V_4 | |||||
| endphoneme | endphoneme | ||||
| phoneme a:U | phoneme a:U | ||||
| vowel starttype (a) endtype (u) | vowel starttype (a) endtype (u) | ||||
| length 250 | |||||
| length 260 | |||||
| formants vdiph/au | formants vdiph/au | ||||
| endphoneme | endphoneme | ||||
| phoneme @U | phoneme @U | ||||
| vowel starttype (@) endtype (u) | vowel starttype (@) endtype (u) | ||||
| length 200 | length 200 | ||||
| formants vdiph/@u_en | |||||
| formants vdiph/Vu_4 | |||||
| endphoneme | endphoneme | ||||
| phoneme @:U | phoneme @:U | ||||
| vowel starttype (@) endtype (u) | vowel starttype (@) endtype (u) | ||||
| length 250 | |||||
| formants vdiph/@u_en | |||||
| length 260 | |||||
| formants vdiph/Vu_4 | |||||
| endphoneme | endphoneme | ||||
| phoneme i@ | phoneme i@ | ||||
| vowel starttype (i) endtype (@) | vowel starttype (i) endtype (@) | ||||
| length 230 | |||||
| length 240 | |||||
| formants vdiph2/ii@_3 | formants vdiph2/ii@_3 | ||||
| endphoneme | endphoneme | ||||
| if(c == '\\') | if(c == '\\') | ||||
| { | { | ||||
| c = *p++; // treat next character literally | c = *p++; // treat next character literally | ||||
| if((c >= '0') && (c <= '2') && (p[0] >= '0') && (p[0] <= '7') && (p[1] >= '0') && (p[1] <= '7')) | |||||
| if((c >= '0') && (c <= '3') && (p[0] >= '0') && (p[0] <= '7') && (p[1] >= '0') && (p[1] <= '7')) | |||||
| { | { | ||||
| // character code given by 3 digit octal value; | // character code given by 3 digit octal value; | ||||
| c = (c-'0')*64 + (p[0]-'0')*8 + (p[1]-'0'); | c = (c-'0')*64 + (p[0]-'0')*8 + (p[1]-'0'); |
| // pitch change during the main part of the clause | // pitch change during the main part of the clause | ||||
| static int drops_0[8] = {0x400,0x400,0x700,0x700,0x700,0xa00,0x1800,0x0e00}; | static int drops_0[8] = {0x400,0x400,0x700,0x700,0x700,0xa00,0x1800,0x0e00}; | ||||
| static int drops_1[8] = {0x400,0x400,0x600,0x600,0xc00,0xc00,0x0e00,0x0e00}; | |||||
| static int drops_2[8] = {0x400,0x400,0x600,0x600,-0x800,0xc00,0x0e00,0x0e00}; | |||||
| //static int drops_1[8] = {0x400,0x400,0x600,0x600,0xc00,0xc00,0x0e00,0x0e00}; | |||||
| //static int drops_2[8] = {0x400,0x400,0x600,0x600,-0x800,0xc00,0x0e00,0x0e00}; | |||||
| static short oflow[] = {0, 20, 12, 4, 0}; | |||||
| static short oflow_emf[] = {5, 24, 15, 10, 5}; | |||||
| static short oflow_less[] = {1, 17, 10, 5, 1}; | |||||
| static short back_emf[] = {36, 32, 0}; | |||||
| typedef struct { | typedef struct { | ||||
| unsigned char pitch_env0; /* pitch envelope, tonic syllable at end */ | |||||
| unsigned char tonic_max0; | |||||
| unsigned char tonic_min0; | |||||
| unsigned char pitch_env0; /* pitch envelope, tonic syllable at end */ | |||||
| unsigned char tonic_max0; | |||||
| unsigned char tonic_min0; | |||||
| unsigned char pitch_env1; /* followed by unstressed */ | |||||
| unsigned char tonic_max1; | |||||
| unsigned char tonic_min1; | |||||
| unsigned char pitch_env1; /* followed by unstressed */ | |||||
| unsigned char tonic_max1; | |||||
| unsigned char tonic_min1; | |||||
| unsigned char pre_start; | |||||
| unsigned char pre_end; | |||||
| unsigned char pre_start; | |||||
| unsigned char pre_end; | |||||
| unsigned char body_start; | |||||
| unsigned char body_end; | |||||
| unsigned char body_start; | |||||
| unsigned char body_end; | |||||
| int *body_drops; | |||||
| unsigned char body_max_steps; | |||||
| unsigned char body_lower_u; | |||||
| int *body_drops; | |||||
| unsigned char body_max_steps; | |||||
| unsigned char body_lower_u; | |||||
| char n_overflow; | |||||
| short *overflow; | |||||
| short *backwards; | |||||
| unsigned char tail_start; | |||||
| unsigned char tail_end; | |||||
| unsigned char tail_shape; | |||||
| unsigned char tail_start; | |||||
| unsigned char tail_end; | |||||
| unsigned char tail_shape; | |||||
| } TONE_TABLE; | } TONE_TABLE; | ||||
| #define N_TONE_TABLE 15 | #define N_TONE_TABLE 15 | ||||
| static TONE_TABLE tone_table[N_TONE_TABLE] = { | static TONE_TABLE tone_table[N_TONE_TABLE] = { | ||||
| {PITCHfall, 30, 5, PITCHfall, 30, 8, // statement | {PITCHfall, 30, 5, PITCHfall, 30, 8, // statement | ||||
| 20, 25, 34, 22, drops_0, 3, 3, 12, 7, 0}, | |||||
| 20, 25, 34, 22, drops_0, 3, 3, 5, oflow, NULL, 12, 7, 0}, | |||||
| {PITCHfrise, 37,10, PITCHfrise2, 35,10, // comma | {PITCHfrise, 37,10, PITCHfrise2, 35,10, // comma | ||||
| 20, 25, 34, 20, drops_0, 3, 3, 15, 24, 0}, | |||||
| 20, 25, 34, 20, drops_0, 3, 3, 5, oflow, NULL, 15, 24, 0}, | |||||
| {PITCHfrise, 39,10, PITCHfrise2, 36,10, // question | {PITCHfrise, 39,10, PITCHfrise2, 36,10, // question | ||||
| 20, 25, 34, 20, drops_0, 3, 3, 15, 29, 0}, | |||||
| {PITCHfall, 36, 0, PITCHfall, 40, 30, // statement, emphatic | |||||
| 20, 25, 34, 22, drops_0, 3, 3, 20, 4, 0}, | |||||
| #ifdef deleted | |||||
| {PITCHfall, 30, 5, PITCHfall, 30, 7, // statement | |||||
| 20, 25, 34, 22, drops_1, 3, 3, 12, 8, 0}, | |||||
| {PITCHfrise, 38,10, PITCHfrise2, 36,10, // comma, or question | |||||
| 20, 25, 34, 20, drops_1, 3, 3, 15, 25, 0}, | |||||
| {PITCHfall, 30, 5, PITCHfall, 30, 7, // exclamation | |||||
| 20, 25, 34, 22, drops_1, 3, 3, 12, 8, 0}, | |||||
| 20, 25, 34, 20, drops_0, 3, 3, 5, oflow, NULL, 15, 29, 0}, | |||||
| {PITCHfall, 41, 4, PITCHfall, 41, 27, // exclamation | |||||
| 20, 25, 34, 24, drops_0, 3, 4, 5, oflow_emf, back_emf, 18, 5, 0}, | |||||
| {PITCHfall, 38, 2, PITCHfall, 42, 30, // statement, emphatic | |||||
| 20, 25, 34, 22, drops_0, 3, 3, 5, oflow, NULL, 15, 5, 0}, | |||||
| {PITCHfall, 30, 5, PITCHfall, 30, 7, // statement | |||||
| 20, 25, 34, 22, drops_2, 3, 3, 12, 8, 0}, | |||||
| {PITCHfrise, 38,10, PITCHfrise2, 36,10, // comma, or question | |||||
| 20, 25, 34, 20, drops_2, 3, 3, 15, 25, 0}, | |||||
| {PITCHfall, 28, 6, PITCHfall, 28, 10, // statement, less intonation | |||||
| 20, 25, 30, 22, drops_0, 4, 3, 5, oflow_less, NULL, 12, 6, 0}, | |||||
| {PITCHfall, 30, 5, PITCHfall, 30, 7, // exclamation | |||||
| 20, 25, 34, 22, drops_2, 3, 3, 12, 8, 0}, | |||||
| {PITCHfrise2, 34,12, PITCHfall, 28,10, // comma, less intonation | |||||
| 20, 25, 30, 22, drops_0, 4, 3, 5, oflow_less, NULL, 9,14, 0}, | |||||
| // alternatives | |||||
| {PITCHfall, 36, 6, PITCHfall, 36, 8, | |||||
| 30, 20, 18, 34, drops_0, 3, 3, 12, 8, 0}, | |||||
| {PITCHfrise, 38, 8, PITCHfrise2, 36, 8, | |||||
| 30, 20, 18, 34, drops_0, 3, 3, 20, 32, 0}, | |||||
| {PITCHfall, 36, 6, PITCHfall, 36, 8, | |||||
| 30, 20, 18, 34, drops_0, 3, 3, 12, 8, 0}, | |||||
| #endif | |||||
| }; | }; | ||||
| number_pre = -1; /* number of vowels before 1st primary stress */ | number_pre = -1; /* number of vowels before 1st primary stress */ | ||||
| number_body = 0; | number_body = 0; | ||||
| number_tail = 0; /* number between tonic syllable and next primary */ | number_tail = 0; /* number between tonic syllable and next primary */ | ||||
| last_primary = 0; | |||||
| last_primary = -1; | |||||
| last2_primary = 0; | last2_primary = 0; | ||||
| for(ix=start; ix<end; ix++) | for(ix=start; ix<end; ix++) | ||||
| } | } | ||||
| if(number_pre < 0) | if(number_pre < 0) | ||||
| number_pre = 0; | |||||
| number_pre = end; | |||||
| number_tail = end - max_stress_posn - 1; | number_tail = end - max_stress_posn - 1; | ||||
| tone_posn = max_stress_posn; | tone_posn = max_stress_posn; | ||||
| tone_posn = tone_posn2 = end-1; | tone_posn = tone_posn2 = end-1; | ||||
| } | } | ||||
| else | else | ||||
| if(end == clause_end) | |||||
| if(last_primary >= 0) | |||||
| { | |||||
| if(end == clause_end) | |||||
| { | |||||
| syllable_tab[last_primary].stress = PRIMARY_LAST; | |||||
| } | |||||
| } | |||||
| else | |||||
| { | { | ||||
| syllable_tab[last_primary].stress = PRIMARY_LAST; | |||||
| // no primary stress. Use the highest stress | |||||
| syllable_tab[tone_posn].stress = PRIMARY_LAST; | |||||
| } | } | ||||
| } /* end of count_pitch_vowels */ | } /* end of count_pitch_vowels */ | ||||
| while(ix < end_ix) | while(ix < end_ix) | ||||
| { | { | ||||
| stress = syllable_tab[ix++].stress; | stress = syllable_tab[ix++].stress; | ||||
| // if(stress >= PRIMARY_MARKED) | |||||
| // break; | |||||
| if(stress >= PRIMARY_LAST) | |||||
| break; | |||||
| if(stress >= min_stress) | if(stress >= min_stress) | ||||
| count++; | count++; | ||||
| int pitch=0; | int pitch=0; | ||||
| int increment=0; | int increment=0; | ||||
| int n_primary=0; | int n_primary=0; | ||||
| int n_steps=0; | |||||
| int initial; | int initial; | ||||
| int overflow=0; | int overflow=0; | ||||
| int n_overflow; | |||||
| int *drops; | int *drops; | ||||
| short *overflow_tab; | short *overflow_tab; | ||||
| SYLLABLE *syl; | SYLLABLE *syl; | ||||
| static short overflow_tab1[5] = {0, 20, 12, 4, 0}; | |||||
| static short continue_tab[5] = {-14, 16, 10, 4, 0}; | |||||
| static short continue_tab[5] = {-13, 16, 10, 4, 0}; | |||||
| drops = t->body_drops; | drops = t->body_drops; | ||||
| { | { | ||||
| initial =0; | initial =0; | ||||
| overflow = 0; | overflow = 0; | ||||
| n_overflow = 5; | |||||
| overflow_tab = continue_tab; | overflow_tab = continue_tab; | ||||
| increment = (t->body_end - t->body_start) << 8; | increment = (t->body_end - t->body_start) << 8; | ||||
| increment = increment / (t->body_max_steps -1); | increment = increment / (t->body_max_steps -1); | ||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| overflow_tab = overflow_tab1; | |||||
| n_overflow = t->n_overflow; | |||||
| overflow_tab = t->overflow; | |||||
| initial = 1; | initial = 1; | ||||
| } | } | ||||
| { | { | ||||
| // a primary stress | // a primary stress | ||||
| if(initial) | |||||
| if((initial) || (stress == 5)) | |||||
| { | { | ||||
| initial = 0; | initial = 0; | ||||
| overflow = 0; | overflow = 0; | ||||
| n_primary = count_increments(ix,end_ix,min_stress); | |||||
| n_steps = n_primary = count_increments(ix,end_ix,min_stress); | |||||
| if(n_primary > t->body_max_steps) | |||||
| n_primary = t->body_max_steps; | |||||
| if(n_steps > t->body_max_steps) | |||||
| n_steps = t->body_max_steps; | |||||
| if(n_primary > 1) | |||||
| if(n_steps > 1) | |||||
| { | { | ||||
| increment = (t->body_end - t->body_start) << 8; | increment = (t->body_end - t->body_start) << 8; | ||||
| increment = increment / (n_primary -1); | |||||
| increment = increment / (n_steps -1); | |||||
| } | } | ||||
| else | else | ||||
| increment = 0; | increment = 0; | ||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| if(n_primary > 0) | |||||
| if(n_steps > 0) | |||||
| pitch += increment; | pitch += increment; | ||||
| else | else | ||||
| { | { | ||||
| pitch = (t->body_end << 8) - (increment * overflow_tab[overflow++])/16; | pitch = (t->body_end << 8) - (increment * overflow_tab[overflow++])/16; | ||||
| if(overflow > 4) | |||||
| if(overflow >= n_overflow) | |||||
| { | { | ||||
| overflow = 0; | overflow = 0; | ||||
| overflow_tab = overflow_tab1; | |||||
| overflow_tab = t->overflow; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| n_steps--; | |||||
| n_primary--; | n_primary--; | ||||
| if((t->backwards) && (n_primary < 2)) | |||||
| { | |||||
| pitch = t->backwards[n_primary] << 8; | |||||
| } | |||||
| } | } | ||||
| if(stress >= PRIMARY) | if(stress >= PRIMARY) | ||||
| option = 0; | option = 0; | ||||
| group_tone_emph = group_tone = punct_to_tone[option][clause_type]; | group_tone_emph = group_tone = punct_to_tone[option][clause_type]; | ||||
| group_tone_emph = punct_to_tone[option][3]; // emphatic form of statement | |||||
| group_tone_emph = punct_to_tone[option][4]; // emphatic form of statement | |||||
| if(clause_type == 4) | if(clause_type == 4) | ||||
| no_tonic = 1; /* incomplete clause, used for abbreviations such as Mr. Dr. Mrs. */ | no_tonic = 1; /* incomplete clause, used for abbreviations such as Mr. Dr. Mrs. */ | ||||
| if(syl->stress >= 4) | if(syl->stress >= 4) | ||||
| count_primary++; | count_primary++; | ||||
| if((syl->stress == 6) && (syllable_tab[st_ix+1].stress == 6)) | |||||
| if(syl->stress == 6) | |||||
| { | { | ||||
| syllable_tab[st_ix].flags = 2; | |||||
| syl->stress = 4; | |||||
| // are the next primary syllables also emphasized ? | |||||
| for(ix=st_ix+1; ix<n_st; ix++) | |||||
| { | |||||
| if(syllable_tab[ix].stress == 4) | |||||
| break; | |||||
| if(syllable_tab[ix].stress == 6) | |||||
| { | |||||
| // emphasize this syllable, but don't end the current tone group | |||||
| syllable_tab[st_ix].flags = 2; | |||||
| syl->stress = 5; | |||||
| break; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| if(syl->stress == 6) | if(syl->stress == 6) | ||||
| { | { | ||||
| // an emphasized syllable, end the tone group after the next primary stress | // an emphasized syllable, end the tone group after the next primary stress |
| #include "translate.h" | #include "translate.h" | ||||
| #include "wave.h" | #include "wave.h" | ||||
| const char *version_string = "1.29.25 14.Dec.07"; | |||||
| const char *version_string = "1.29.26 18.Dec.07"; | |||||
| const int version_phdata = 0x012924; | const int version_phdata = 0x012924; | ||||
| int option_device_number = -1; | int option_device_number = -1; |
| /* index by 0=. 1=, 2=?, 3=! 4=none */ | /* index by 0=. 1=, 2=?, 3=! 4=none */ | ||||
| static unsigned char punctuation_to_tone[4][5] = { | static unsigned char punctuation_to_tone[4][5] = { | ||||
| {0,1,2,3,0}, | |||||
| {0,1,2,3,0}, | |||||
| {0,1,2,3,4}, | |||||
| {5,6,2,0,4}, | |||||
| {0,1,2,3,0}, | {0,1,2,3,0}, | ||||
| {0,1,2,3,0} }; | {0,1,2,3,0} }; | ||||
| if((c >= 0x901) && (c <= 0x957)) | if((c >= 0x901) && (c <= 0x957)) | ||||
| return(1); // Devanagari vowel signs and other signs | return(1); // Devanagari vowel signs and other signs | ||||
| if((c >= 0x300) && (c <= 0x36f)) | |||||
| return(1); // combining accents | |||||
| return(0); | return(0); | ||||
| } | } | ||||
| if(delay == 0) | if(delay == 0) | ||||
| amp = 0; | amp = 0; | ||||
| echo_head = (delay * samplerate)/1000; | echo_head = (delay * samplerate)/1000; | ||||
| echo_length = echo_head; // ensure completion of echo at the end of speech | |||||
| // echo_length = echo_head * 2; // perhaps allow 2 echo periods at the end of speech ? | |||||
| echo_length = echo_head; // ensure completion of echo at the end of speech. Use 1 delay period? | |||||
| if(amp > 20) | |||||
| echo_length = echo_head * 2; // perhaps allow 2 echo periods if the echo is loud. | |||||
| // echo_amp units are 1/256ths of the amplitude of the original sound. | // echo_amp units are 1/256ths of the amplitude of the original sound. | ||||
| echo_amp = amp; | echo_amp = amp; |