12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781 |
-
-
- #include "StdAfx.h"
-
- #include <stdio.h>
- #include <ctype.h>
- #include <wctype.h>
- #include <stdlib.h>
- #include <string.h>
- #include <locale.h>
-
- #include <wctype.h>
-
- #include "speak_lib.h"
- #include "speech.h"
- #include "phoneme.h"
- #include "synthesize.h"
- #include "translate.h"
-
-
-
- #define L_qa 0x716100
- #define L_grc 0x677263
- #define L_jbo 0x6a626f
- #define L_pap 0x706170
- #define L_qvi 0x717669
- #define L_shs 0x736873
- #define L_zhy 0x7a6879
-
-
- #define OFFSET_GREEK 0x380
- #define OFFSET_CYRILLIC 0x420
- #define OFFSET_ARMENIAN 0x530
- #define OFFSET_HEBREW 0x590
- #define OFFSET_ARABIC 0x600
- #define OFFSET_THAANA 0x780
- #define OFFSET_DEVANAGARI 0x900
- #define OFFSET_BENGALI 0x980
- #define OFFSET_GURMUKHI 0xa00
- #define OFFSET_GUJARATI 0xa80
- #define OFFSET_ORIYA 0xb00
- #define OFFSET_TAMIL 0xb80
- #define OFFSET_TELUGU 0xc00
- #define OFFSET_KANNADA 0xc80
- #define OFFSET_MALAYALAM 0xd00
- #define OFFSET_SINHALA 0x0d80
- #define OFFSET_THAI 0x0e00
- #define OFFSET_LAO 0x0e80
- #define OFFSET_TIBET 0x0f00
- #define OFFSET_MYANMAR 0x1000
- #define OFFSET_GEORGIAN 0x10a0
- #define OFFSET_KOREAN 0x1100
- #define OFFSET_ETHIOPIC 0x1200
-
-
-
- ALPHABET alphabets [] = {
- {"_el", OFFSET_GREEK, 0x380, 0x3ff, L('e','l'), AL_DONT_NAME | AL_NOT_LETTERS},
- {"_cyr", OFFSET_CYRILLIC, 0x400, 0x52f, 0, 0},
- {"_hy", OFFSET_ARMENIAN, 0x530, 0x58f, L('h','y'), AL_WORDS},
- {"_he", OFFSET_HEBREW, 0x590, 0x5ff, 0, 0},
- {"_ar", OFFSET_ARABIC, 0x600, 0x6ff, 0, 0},
- {"_dv", OFFSET_THAANA, 0x780, 0x7bf, 0, 0},
- {"_hi", OFFSET_DEVANAGARI, 0x900, 0x97f,L('h','i'), AL_WORDS},
- {"_bn", OFFSET_BENGALI, 0x0980, 0x9ff, 0, 0},
- {"_gur", OFFSET_GURMUKHI, 0xa00, 0xa7f, L('p','a'), AL_WORDS},
- {"_gu", OFFSET_GUJARATI, 0xa80, 0xaff, 0, 0},
- {"_or", OFFSET_ORIYA, 0xb00, 0xb7f, 0, 0},
- {"_ta", OFFSET_TAMIL, 0xb80, 0xbff, L('t','a'), AL_WORDS},
- {"_te", OFFSET_TELUGU, 0xc00, 0xc7f, L('t','e'), 0},
- {"_kn", OFFSET_KANNADA, 0xc80, 0xcff, L('k','n'), AL_WORDS},
- {"_ml", OFFSET_MALAYALAM,0xd00, 0xd7f, L('m','l'), AL_WORDS},
- {"_si", OFFSET_SINHALA, 0xd80, 0xdff, 0, 0},
- {"_th", OFFSET_THAI, 0xe00, 0xe7f, 0, 0},
- {"_lo", OFFSET_LAO, 0xe80, 0xeff, 0, 0},
- {"_ti", OFFSET_TIBET, 0xf00, 0xfff, 0, 0},
- {"_my", OFFSET_MYANMAR, 0x1000,0x109f, 0, 0},
- {"_ka", OFFSET_GEORGIAN, 0x10a0,0x10ff, L('k','a'), AL_WORDS},
- {"_ko", OFFSET_KOREAN, 0x1100,0x11ff, 0, 0},
- {"_eth", OFFSET_ETHIOPIC, 0x1200,0x139f, 0, 0},
- {"_braille", 0x2800, 0x2800,0x28ff, 0, AL_NO_SYMBOL},
- {"_ja", 0x3040, 0x3040,0x30ff, 0, AL_NOT_CODE},
- {"_zh", 0x3100, 0x3100,0x9fff, 0, AL_NOT_CODE},
- {"_ko", 0xa700, 0xa700,0xd7ff, 0, AL_NOT_CODE},
- {NULL, 0, 0, 0, 0, 0}
- };
-
-
- 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)
- {
-
- ALPHABET *alphabet = alphabets;
-
- while(alphabet->name != NULL)
- {
- if(c <= alphabet->range_max)
- {
- if(c >= alphabet->range_min)
- return(alphabet);
- else
- break;
- }
- alphabet++;
- }
- return(NULL);
- }
-
-
-
- static void Translator_Russian(Translator *tr);
-
-
-
- static void SetLetterVowel(Translator *tr, int c)
- {
- tr->letter_bits[c] = (tr->letter_bits[c] & 0x40) | 0x81;
- }
-
- static void ResetLetterBits(Translator *tr, int groups)
- {
-
- unsigned int ix;
- unsigned int mask;
-
- mask = ~groups;
-
- for(ix=0; ix<sizeof(tr->letter_bits); ix++)
- {
- tr->letter_bits[ix] &= mask;
- }
- }
-
- static void SetLetterBits(Translator *tr, int group, const char *string)
- {
- int bits;
- unsigned char c;
-
- bits = (1L << group);
- while((c = *string++) != 0)
- tr->letter_bits[c] |= bits;
- }
-
- static void SetLetterBitsRange(Translator *tr, int group, int first, int last)
- {
- int bits;
- int ix;
-
- bits = (1L << group);
- for(ix=first; ix<=last; ix++)
- {
- tr->letter_bits[ix] |= bits;
- }
- }
-
-
- static const unsigned short chars_ignore_default[] = {
- 0xad, 1,
- 0x200c, 1,
- 0x200d, 1,
- 0, 0 };
-
-
- static const unsigned short chars_ignore_zwnj_hyphen[] = {
- 0xad, 1,
- 0x200c, '-',
- 0x200d, 1,
- 0, 0 };
-
-
- static Translator* NewTranslator(void)
- {
- Translator *tr;
- int ix;
- static const unsigned char stress_amps2[] = {18,18, 20,20, 20,22, 22,20 };
- static const short stress_lengths2[8] = {182,140, 220,220, 220,240, 260,280};
- static const wchar_t empty_wstring[1] = {0};
- static const wchar_t punct_in_word[2] = {'\'', 0};
- static const unsigned char default_tunes[6] = {0, 1, 2, 3, 0, 0};
-
-
-
-
- static const char transpose_map_latin[] = {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 27, 28, 29, 0, 0, 30, 31, 32, 33, 34, 35, 36, 0, 37, 38, 0,
- 0, 0, 0, 39, 0, 0, 40, 0, 41, 0, 42, 0, 43, 0, 0, 0,
- 0, 0, 0, 44, 0, 45, 0, 46, 0, 0, 0, 0, 0, 47, 0, 0,
- 0, 48, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 50, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0,
- 0, 53, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 56, 0, 57, 0,
- };
-
- tr = (Translator *)Alloc(sizeof(Translator));
- if(tr == NULL)
- return(NULL);
-
- tr->charset_a0 = charsets[1];
- dictionary_name[0] = 0;
- tr->dict_condition=0;
- tr->dict_min_size = 0;
- tr->data_dictrules = NULL;
- tr->data_dictlist = NULL;
-
- tr->transpose_min = 0x60;
- tr->transpose_max = 0x17f;
- tr->transpose_map = transpose_map_latin;
- tr->frequent_pairs = NULL;
-
-
- tr->letter_bits_offset = 0;
- memset(tr->letter_bits,0,sizeof(tr->letter_bits));
- memset(tr->letter_groups,0,sizeof(tr->letter_groups));
-
-
-
- SetLetterBits(tr,0,"aeiou");
- SetLetterBits(tr,1,"bcdfgjklmnpqstvxz");
- SetLetterBits(tr,2,"bcdfghjklmnpqrstvwxz");
- SetLetterBits(tr,3,"hlmnr");
- SetLetterBits(tr,4,"cfhkpqstx");
- SetLetterBits(tr,5,"bdgjlmnrvwyz");
- SetLetterBits(tr,6,"eiy");
- SetLetterBits(tr,7,"aeiouy");
-
-
- tr->char_plus_apostrophe = empty_wstring;
- tr->punct_within_word = punct_in_word;
- tr->chars_ignore = chars_ignore_default;
-
- for(ix=0; ix<8; ix++)
- {
- tr->stress_amps[ix] = stress_amps2[ix];
- tr->stress_amps_r[ix] = stress_amps2[ix] - 1;
- tr->stress_lengths[ix] = stress_lengths2[ix];
- }
- memset(&(tr->langopts),0,sizeof(tr->langopts));
- tr->langopts.max_lengthmod = 500;
- tr->langopts.lengthen_tonic = 20;
-
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.unstressed_wd1 = 1;
- tr->langopts.unstressed_wd2 = 3;
- tr->langopts.param[LOPT_SONORANT_MIN] = 95;
- tr->langopts.param[LOPT_LONG_VOWEL_THRESHOLD] = 190/2;
- tr->langopts.param[LOPT_MAXAMP_EOC] = 19;
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 's';
- tr->langopts.param[LOPT_BRACKET_PAUSE] = 4;
- tr->langopts.param2[LOPT_BRACKET_PAUSE] = 2;
- tr->langopts.max_initial_consonants = 3;
- tr->langopts.replace_chars = NULL;
- tr->langopts.ascii_language[0] = 0;
- tr->langopts.alt_alphabet_lang = L('e','n');
-
- SetLengthMods(tr,201);
-
-
-
- tr->langopts.long_stop = 100;
-
- tr->langopts.max_roman = 49;
- tr->langopts.min_roman = 2;
- tr->langopts.thousands_sep = ',';
- tr->langopts.decimal_sep = '.';
- tr->langopts.break_numbers = BREAK_THOUSANDS;
- tr->langopts.max_digits = 14;
-
- memcpy(tr->punct_to_tone, punctuation_to_tone, sizeof(tr->punct_to_tone));
-
- memcpy(tr->langopts.tunes, default_tunes, sizeof(tr->langopts.tunes));
-
- return(tr);
- }
-
-
-
- static const short pairs_ru[] = {
- 0x010c,
- 0x010e,
- 0x0113,
- 0x0301,
- 0x030f,
- 0x060e,
- 0x0611,
- 0x0903,
- 0x0b01,
- 0x0b0f,
- 0x0c01,
- 0x0c09,
- 0x0e01,
- 0x0e06,
- 0x0e09,
- 0x0e0e,
- 0x0e0f,
- 0x0e1c,
- 0x0f03,
- 0x0f11,
- 0x0f12,
- 0x100f,
- 0x1011,
- 0x1101,
- 0x1106,
- 0x1109,
- 0x110f,
- 0x1213,
- 0x1220,
- 0x7fff};
-
-
-
-
-
-
- static const unsigned int replace_cyrillic_latin[] =
- {0x430,'a',
- 0x431,'b',
- 0x446,'c',
- 0x45b,0x107,
- 0x447,0x10d,
- 0x45f,'d'+(0x17e<<16),
- 0x455,'d'+('z'<<16),
- 0x434,'d',
- 0x452,0x111,
- 0x435,'e',
- 0x444,'f',
- 0x433,'g',
- 0x445,'h',
- 0x438,'i',
- 0x458,'j',
- 0x43a,'k',
- 0x459,'l'+('j'<<16),
- 0x43b,'l',
- 0x43c,'m',
- 0x45a,'n'+('j'<<16),
- 0x43d,'n',
- 0x43e,'o',
- 0x43f,'p',
- 0x440,'r',
- 0x441,'s',
- 0x448,0x161,
- 0x442,'t',
- 0x443,'u',
- 0x432,'v',
- 0x437,'z',
- 0x436,0x17e,
- 0x453,0x111,
- 0x45c,0x107,
- 0};
-
-
- static const unsigned char ru_vowels[] = {0x10,0x15,0x31,0x18,0x1e,0x23,0x2b,0x2d,0x2e,0x2f, 0xb9,0xc9,0x91,0x8f,0x36,0};
- static const unsigned char ru_consonants[] = {0x11,0x12,0x13,0x14,0x16,0x17,0x19,0x1a,0x1b,0x1c,0x1d,0x1f,0x20,0x21,0x22,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2c, 0x73,0x7b,0x83,0x9b,0};
-
- static void SetCyrillicLetters(Translator *tr)
- {
-
- static const char ru_soft[] = {0x2c,0x19,0x27,0x29,0};
- static const char ru_hard[] = {0x2a,0x16,0x26,0x28,0};
- static const char ru_nothard[] = {0x11,0x12,0x13,0x14,0x17,0x19,0x1a,0x1b,0x1c,0x1d,0x1f,0x20,0x21,0x22,0x24,0x25,0x27,0x29,0x2c,0};
- static const char ru_voiced[] = {0x11,0x12,0x13,0x14,0x16,0x17,0};
- static const char ru_ivowels[] = {0x2c,0x2e,0x2f,0x31,0};
- tr->charset_a0 = charsets[18];
- tr->transpose_min = 0x430;
- tr->transpose_max = 0x451;
- tr->transpose_map = NULL;
- tr->frequent_pairs = pairs_ru;
-
- tr->letter_bits_offset = OFFSET_CYRILLIC;
- memset(tr->letter_bits,0,sizeof(tr->letter_bits));
- SetLetterBits(tr,LETTERGP_A,(char *)ru_vowels);
- SetLetterBits(tr,LETTERGP_B,ru_soft);
- SetLetterBits(tr,LETTERGP_C,(char *)ru_consonants);
- SetLetterBits(tr,LETTERGP_H,ru_hard);
- SetLetterBits(tr,LETTERGP_F,ru_nothard);
- SetLetterBits(tr,LETTERGP_G,ru_voiced);
- SetLetterBits(tr,LETTERGP_Y,ru_ivowels);
- SetLetterBits(tr,LETTERGP_VOWEL2,(char *)ru_vowels);
- }
-
-
- void SetIndicLetters(Translator *tr)
- {
-
- static const char dev_consonants2[] = {0x02,0x03,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,0x7b,0x7c,0x7e,0x7f,0};
- static const char dev_vowels2[] = {0x60,0x61, 0x55,0x56,0x57,0x62,0x63,0};
-
- memset(tr->letter_bits,0,sizeof(tr->letter_bits));
- SetLetterBitsRange(tr,LETTERGP_A,0x04,0x14);
- SetLetterBitsRange(tr,LETTERGP_A,0x3e,0x4d);
- SetLetterBits(tr,LETTERGP_A, dev_vowels2);
-
- SetLetterBitsRange(tr,LETTERGP_B,0x3e,0x4d);
- SetLetterBits(tr,LETTERGP_B, dev_vowels2);
-
- SetLetterBitsRange(tr,LETTERGP_C,0x15,0x39);
- SetLetterBits(tr,LETTERGP_C,dev_consonants2);
-
- SetLetterBitsRange(tr,LETTERGP_Y,0x04,0x14);
- SetLetterBitsRange(tr,LETTERGP_Y,0x3e,0x4c);
- SetLetterBits(tr,LETTERGP_Y, dev_vowels2);
-
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1;
- tr->langopts.suffix_add_e = tr->letter_bits_offset + 0x4d;
- }
-
-
- void SetupTranslator(Translator *tr, const short *lengths, const unsigned char *amps)
- {
- if(lengths != NULL)
- memcpy(tr->stress_lengths,lengths,sizeof(tr->stress_lengths));
- if(amps != NULL)
- memcpy(tr->stress_amps,amps,sizeof(tr->stress_amps));
- }
-
-
- Translator *SelectTranslator(const char *name)
- {
- int name2 = 0;
- Translator *tr;
-
- static const short stress_lengths_equal[8] = {230, 230, 230, 230, 0, 0, 230, 230};
- static const unsigned char stress_amps_equal[8] = {18,18, 18,18, 18,18, 18,18 };
-
- static const short stress_lengths_fr[8] = {190, 170, 190, 200, 0, 0, 190, 240};
- static const unsigned char stress_amps_fr[8] = {18,16, 18,18, 18,18, 18,18 };
-
- static const unsigned char stress_amps_sk[8] = {17,16, 20,20, 20,22, 22,21 };
- static const short stress_lengths_sk[8] = {190,190, 210,210, 0,0, 210,210};
-
- static const short stress_lengths_ta[8] = {200, 200, 210, 210, 0, 0, 230, 230};
- 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 };
-
-
- while(*name != 0)
- name2 = (name2 << 8) + *name++;
-
- tr = NewTranslator();
-
- switch(name2)
- {
- case L('a','f'):
- {
- static const short stress_lengths_af[8] = {170,140, 220,220, 0, 0, 250,270};
- SetupTranslator(tr,stress_lengths_af,NULL);
-
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.vowel_pause = 0x30;
- tr->langopts.param[LOPT_DIERESES] = 1;
- tr->langopts.param[LOPT_PREFIXES] = 1;
- SetLetterVowel(tr,'y');
-
- tr->langopts.numbers = NUM_SWAP_TENS | NUM_HUNDRED_AND | NUM_SINGLE_AND | NUM_ROMAN | NUM_1900;
- tr->langopts.accents = 1;
- }
- break;
-
- case L('a','m'):
- {
- SetupTranslator(tr,stress_lengths_fr,stress_amps_fr);
- tr->letter_bits_offset = OFFSET_ETHIOPIC;
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.stress_flags = S_NO_AUTO_2 | S_FINAL_DIM;
- tr->langopts.length_mods0 = tr->langopts.length_mods;
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1;
- tr->langopts.numbers = NUM_OMIT_1_HUNDRED;
- }
- break;
-
-
- case L('a','r'):
- tr->letter_bits_offset = OFFSET_ARABIC;
- tr->langopts.numbers = NUM_SWAP_TENS | NUM_AND_UNITS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_AND_HUNDRED | NUM_THOUSAND_AND | NUM_OMIT_1_THOUSAND;
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1;
- break;
-
- case L('b','g'):
- {
- SetCyrillicLetters(tr);
- SetLetterVowel(tr,0x2a);
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 0x432;
- tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x107;
- tr->langopts.param[LOPT_REDUCE] = 2;
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_OMIT_1_HUNDRED | NUM_HUNDRED_AND | NUM_AND_UNITS | NUM_SINGLE_AND | NUM_ROMAN | NUM_ROMAN_ORDINAL | NUM_ROMAN_CAPITALS ;
- tr->langopts.thousands_sep = ' ';
- }
- break;
-
- case L('b','n'):
- {
- static const short stress_lengths_bn[8] = {180, 180, 210, 210, 0, 0, 230, 240};
- static const unsigned char stress_amps_bn[8] = {18,18, 18,18, 20,20, 22,22 };
-
- SetupTranslator(tr,stress_lengths_bn,stress_amps_bn);
- tr->langopts.length_mods0 = tr->langopts.length_mods;
-
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.stress_flags = S_MID_DIM | S_FINAL_DIM;
- tr->letter_bits_offset = OFFSET_BENGALI;
- SetIndicLetters(tr);
- SetLetterBitsRange(tr,LETTERGP_B,0x01,0x01);
- SetLetterBitsRange(tr,LETTERGP_F,0x3e,0x4c);
-
- tr->langopts.numbers = NUM_SWAP_TENS;
- tr->langopts.break_numbers = 0x24924aa8;
- }
- break;
-
- case L('b','o'):
- {
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->letter_bits_offset = OFFSET_TIBET;
- SetLetterBitsRange(tr,LETTERGP_A,0x71,0x7d);
- SetLetterBitsRange(tr,LETTERGP_B,0x71,0x81);
- SetLetterBitsRange(tr,LETTERGP_B,0x90,0xbc);
- SetLetterBitsRange(tr,LETTERGP_C,0x40,0x6c);
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1;
- tr->langopts.numbers = 1;
- }
- break;
-
- case L('c','y'):
- {
- static const short stress_lengths_cy[8] = {170,220, 180,180, 0, 0, 250,270};
- static const unsigned char stress_amps_cy[8] = {17,15, 18,18, 0,0, 22,20 };
-
- SetupTranslator(tr,stress_lengths_cy,stress_amps_cy);
-
- tr->charset_a0 = charsets[14];
-
- tr->langopts.stress_rule = STRESSPOSN_2R;
-
-
-
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2;
- tr->langopts.unstressed_wd1 = 0;
- tr->langopts.unstressed_wd2 = 2;
- tr->langopts.param[LOPT_SONORANT_MIN] = 120;
-
- tr->langopts.numbers = NUM_OMIT_1_HUNDRED;
-
- SetLetterVowel(tr,'w');
- SetLetterVowel(tr,'y');
- }
- break;
-
- case L('d','a'):
- {
- static const short stress_lengths_da[8] = {160,140, 200,200, 0,0, 220,230};
- SetupTranslator(tr,stress_lengths_da,NULL);
-
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.param[LOPT_PREFIXES] = 1;
- SetLetterVowel(tr,'y');
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_SWAP_TENS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_ORDINAL_DOT | NUM_1900 | NUM_ROMAN | NUM_ROMAN_CAPITALS | NUM_ROMAN_ORDINAL;
- }
- break;
-
-
- case L('d','e'):
- {
- static const short stress_lengths_de[8] = {150,130, 200,200, 0, 0, 270,270};
- static const unsigned char stress_amps_de[] = {20,20, 20,20, 20,22, 22,20 };
- SetupTranslator(tr, stress_lengths_de, stress_amps_de);
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.word_gap = 0x8;
- tr->langopts.vowel_pause = 0x30;
- tr->langopts.param[LOPT_PREFIXES] = 1;
- tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x100;
- tr->langopts.param[LOPT_LONG_VOWEL_THRESHOLD] = 175/2;
-
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_SWAP_TENS | NUM_ALLOW_SPACE | NUM_ORDINAL_DOT | NUM_ROMAN;
-
- SetLetterVowel(tr,'y');
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 2;
- }
- break;
-
- case L('d','v'):
- {
- SetupTranslator(tr,stress_lengths_ta,stress_amps_ta);
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1;
- tr->langopts.length_mods0 = tr->langopts.length_mods;
- tr->letter_bits_offset = OFFSET_THAANA;
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.stress_flags = S_MID_DIM | S_FINAL_DIM;
- SetLetterBitsRange(tr,LETTERGP_B,0x26,0x30);
- tr->langopts.break_numbers = 0x14a8;
- tr->langopts.numbers = 1;
- }
- break;
-
- case L('e','n'):
- {
- static const short stress_lengths_en[8] = {182,140, 220,220, 0,0, 248,275};
- SetupTranslator(tr,stress_lengths_en,NULL);
-
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.stress_flags = 0x08;
- tr->langopts.numbers = NUM_HUNDRED_AND | NUM_ROMAN | NUM_1900;
- tr->langopts.param[LOPT_COMBINE_WORDS] = 2;
- tr->langopts.suffix_add_e = 'e';
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 2;
- SetLetterBits(tr,6,"aeiouy");
- }
- break;
-
- case L('e','l'):
- case L_grc:
- {
- static const short stress_lengths_el[8] = {155, 180, 210, 210, 0, 0, 270, 300};
- static const unsigned char stress_amps_el[8] = {15,12, 20,20, 20,22, 22,21 };
-
-
- static const char el_vowels[] = {0x10,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x35,0x37,0x39,0x3f,0x45,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0};
- static const char el_fvowels[] = {0x2d,0x2e,0x2f,0x35,0x37,0x39,0x45,0x4d,0};
- static const char el_voiceless[]= {0x38,0x3a,0x3e,0x40,0x42,0x43,0x44,0x46,0x47,0};
- static const char el_consonants[]={0x32,0x33,0x34,0x36,0x38,0x3a,0x3b,0x3c,0x3d,0x3e,0x40,0x41,0x42,0x43,0x44,0x46,0x47,0x48,0};
- static const wchar_t el_char_apostrophe[] = {0x3c3,0};
-
- SetupTranslator(tr,stress_lengths_el,stress_amps_el);
-
- tr->charset_a0 = charsets[7];
- tr->char_plus_apostrophe = el_char_apostrophe;
-
- tr->letter_bits_offset = OFFSET_GREEK;
- memset(tr->letter_bits,0,sizeof(tr->letter_bits));
- SetLetterBits(tr,LETTERGP_A,el_vowels);
- SetLetterBits(tr,LETTERGP_VOWEL2,el_vowels);
- SetLetterBits(tr,LETTERGP_B,el_voiceless);
- SetLetterBits(tr,LETTERGP_C,el_consonants);
- SetLetterBits(tr,LETTERGP_Y,el_fvowels);
-
- tr->langopts.length_mods0 = tr->langopts.length_mods;
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY;
- tr->langopts.unstressed_wd1 = 0;
- tr->langopts.unstressed_wd2 = 2;
- tr->langopts.param[LOPT_SONORANT_MIN] = 130;
-
- tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_DECIMAL_COMMA;
- tr->langopts.numbers2 = 0x2 | NUM2_MULTIPLE_ORDINAL | NUM2_ORDINAL_NO_AND;
-
- if(name2 == L_grc)
- {
-
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1;
- }
- }
- break;
-
- case L('e','o'):
- {
- static const short stress_lengths_eo[8] = {150, 150, 230, 180, 0, 0, 300, 320};
- static const unsigned char stress_amps_eo[] = {16,14, 20,20, 20,22, 22,21 };
- static const wchar_t eo_char_apostrophe[2] = {'l',0};
-
- SetupTranslator(tr,stress_lengths_eo,stress_amps_eo);
-
- tr->charset_a0 = charsets[3];
- tr->char_plus_apostrophe = eo_char_apostrophe;
-
-
- tr->langopts.vowel_pause = 2;
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2;
-
- tr->langopts.unstressed_wd2 = 2;
-
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED | NUM_ALLOW_SPACE | NUM_ROMAN;
- }
- break;
-
- case L('e','s'):
- case L('a','n'):
- case L('c','a'):
- case L_pap:
- {
- static const short stress_lengths_es[8] = {180, 190, 230, 180, 0, 0, 240, 270};
- static const unsigned char stress_amps_es[8] = {16,12, 18,18, 20,20, 20,20 };
- static const wchar_t ca_punct_within_word[] = {'\'',0xb7,0};
-
- SetupTranslator(tr,stress_lengths_es,stress_amps_es);
-
- tr->langopts.length_mods0 = tr->langopts.length_mods;
- tr->langopts.stress_rule = STRESSPOSN_2R;
-
-
-
- tr->langopts.stress_flags = S_FINAL_SPANISH | S_FINAL_DIM_ONLY | S_FINAL_NO_2;
- tr->langopts.unstressed_wd1 = 0;
- tr->langopts.unstressed_wd2 = 2;
- tr->langopts.param[LOPT_SONORANT_MIN] = 120;
-
- tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_DECIMAL_COMMA | NUM_AND_UNITS | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND | NUM_ROMAN | NUM_ROMAN_AFTER;
- tr->langopts.numbers2 = NUM2_MULTIPLE_ORDINAL | NUM2_ORDINAL_NO_AND;
-
- if(name2 == L('c','a'))
- {
-
- tr->punct_within_word = ca_punct_within_word;
- tr->langopts.stress_flags = S_FINAL_SPANISH | S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_NO_AUTO_2;
- }
- else
- if(name2 == L('a','n'))
- {
- tr->langopts.stress_flags = S_FINAL_SPANISH | S_FINAL_DIM_ONLY | S_FINAL_NO_2;
- tr->langopts.numbers2 = NUM2_ORDINAL_NO_AND;
- }
- else
- if(name2 == L_pap)
- {
-
- tr->langopts.stress_flags = S_FINAL_STRESS_C | S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_NO_AUTO_2;
- }
- else
- {
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 2;
- }
- }
- break;
-
- case L('e','u'):
- {
- static const short stress_lengths_eu[8] = {200, 200, 200, 200, 0, 0, 210, 230};
- static const unsigned char stress_amps_eu[8] = {16,16, 18,18, 18,18, 18,18 };
- SetupTranslator(tr,stress_lengths_eu,stress_amps_eu);
- tr->langopts.stress_rule = STRESSPOSN_2L;
- tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_DECIMAL_COMMA | NUM_AND_UNITS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_VIGESIMAL;
- }
- break;
-
-
- case L('f','a'):
- {
-
-
- static const char transpose_map_fa[] = {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 0, 0, 0, 0,
- 0, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0,
- 0, 0, 0, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 0, 0, 0, 0, 49,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51 };
- tr->transpose_min = 0x620;
- tr->transpose_max = 0x6cc;
- tr->transpose_map = transpose_map_fa;
- tr->letter_bits_offset = OFFSET_ARABIC;
-
- tr->langopts.numbers = NUM_AND_UNITS | NUM_HUNDRED_AND;
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1;
-
- tr->chars_ignore = chars_ignore_zwnj_hyphen;
- }
- break;
-
-
- case L('e','t'):
- tr->charset_a0 = charsets[4];
-
- case L('f','i'):
- {
- static const unsigned char stress_amps_fi[8] = {18,16, 22,22, 20,22, 22,22 };
- static const short stress_lengths_fi[8] = {150,180, 200,200, 0,0, 210,250};
-
- SetupTranslator(tr,stress_lengths_fi,stress_amps_fi);
-
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_2_TO_HEAVY;
- tr->langopts.param[LOPT_IT_DOUBLING] = 1;
- tr->langopts.long_stop = 130;
-
- tr->langopts.numbers = NUM_DECIMAL_COMMA + NUM_ALLOW_SPACE;
- SetLetterVowel(tr,'y');
-
- tr->langopts.spelling_stress = 1;
- tr->langopts.intonation_group = 3;
- }
- break;
-
- case L('f','r'):
- {
- SetupTranslator(tr,stress_lengths_fr,stress_amps_fr);
- tr->langopts.stress_rule = STRESSPOSN_1R;
- tr->langopts.stress_flags = S_NO_AUTO_2 | S_FINAL_DIM;
- tr->langopts.param[LOPT_IT_LENGTHEN] = 1;
- tr->langopts.length_mods0 = tr->langopts.length_mods;
- tr->langopts.accents = 2;
-
- tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_OMIT_1_HUNDRED | NUM_NOPAUSE | NUM_ROMAN | NUM_ROMAN_CAPITALS | NUM_ROMAN_AFTER | NUM_VIGESIMAL | NUM_DFRACTION_4;
- SetLetterVowel(tr,'y');
- }
- break;
-
- case L('g','a'):
- {
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.numbers = 1;
- tr->langopts.accents = 2;
- }
- break;
-
- case L('h','i'):
- case L('n','e'):
- case L('p','a'):
- case L('g','u'):
- {
- static const short stress_lengths_hi[8] = {190, 190, 210, 210, 0, 0, 230, 250};
- static const unsigned char stress_amps_hi[8] = {17,14, 20,19, 20,22, 22,21 };
-
- SetupTranslator(tr,stress_lengths_hi,stress_amps_hi);
- tr->charset_a0 = charsets[19];
- tr->langopts.length_mods0 = tr->langopts.length_mods;
-
- tr->langopts.stress_rule = 6;
- tr->langopts.stress_flags = S_MID_DIM | S_FINAL_DIM;
- tr->langopts.numbers = NUM_SWAP_TENS;
- tr->langopts.break_numbers = 0x14aa8;
- tr->letter_bits_offset = OFFSET_DEVANAGARI;
-
- if(name2 == L('p','a'))
- {
- tr->letter_bits_offset = OFFSET_GURMUKHI;
- }
- else
- if(name2 == L('g','u'))
- {
- SetupTranslator(tr,stress_lengths_equal,stress_amps_equal);
- tr->letter_bits_offset = OFFSET_GUJARATI;
- tr->langopts.stress_rule = STRESSPOSN_2R;
- }
- else
- if(name2 == L('n','e'))
- {
- SetupTranslator(tr,stress_lengths_equal,stress_amps_equal);
- tr->langopts.break_numbers = 0x2aaaa8;
- tr->langopts.max_digits = 22;
- tr->langopts.numbers2 |= NUM2_ENGLISH_NUMERALS;
- }
- SetIndicLetters(tr);
- }
- break;
-
-
- case L('h','r'):
- case L('b','s'):
- case L('s','r'):
- {
- static const unsigned char stress_amps_hr[8] = {17,17, 20,20, 20,22, 22,21 };
- 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};
-
- if(name2 == L('s','r'))
- SetupTranslator(tr,stress_lengths_sr,stress_amps_hr);
- else
- SetupTranslator(tr,stress_lengths_hr,stress_amps_hr);
- tr->charset_a0 = charsets[2];
-
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.stress_flags = S_FINAL_NO_2;
- tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x3;
- tr->langopts.max_initial_consonants = 5;
- tr->langopts.spelling_stress = 1;
- tr->langopts.accents = 1;
-
- tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_DECIMAL_COMMA | NUM_THOUS_SPACE | NUM_DFRACTION_2 | NUM_ROMAN_CAPITALS;
- tr->langopts.numbers2 = 0xa + NUM2_THOUSANDS_VAR5;
- tr->langopts.replace_chars = replace_cyrillic_latin;
-
- SetLetterVowel(tr,'y');
- SetLetterVowel(tr,'r');
- }
- break;
-
-
- case L('h','t'):
-
- tr->langopts.stress_rule = STRESSPOSN_1R;
- tr->langopts.stress_flags = S_NO_AUTO_2 | S_FINAL_DIM;
- tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_OMIT_1_HUNDRED | NUM_NOPAUSE | NUM_ROMAN | NUM_VIGESIMAL | NUM_DFRACTION_4;
- break;
-
-
- case L('h','u'):
- {
- static const unsigned char stress_amps_hu[8] = {17,17, 19,19, 20,22, 22,21 };
- static const short stress_lengths_hu[8] = {185,195, 195,190, 0,0, 210,220};
-
- SetupTranslator(tr,stress_lengths_hu,stress_amps_hu);
- tr->charset_a0 = charsets[2];
-
- tr->langopts.vowel_pause = 0x20;
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_NO_AUTO_2 | 0x8000 | S_HYPEN_UNSTRESS;
- tr->langopts.unstressed_wd1 = 2;
- tr->langopts.param[LOPT_IT_DOUBLING] = 1;
- tr->langopts.param[LOPT_ANNOUNCE_PUNCT] = 2;
-
- tr->langopts.numbers = NUM_DFRACTION_5 | NUM_ALLOW_SPACE | NUM_ROMAN | NUM_ROMAN_ORDINAL | NUM_ROMAN_CAPITALS | NUM_ORDINAL_DOT | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND;
- tr->langopts.thousands_sep = ' ';
- tr->langopts.decimal_sep = ',';
- tr->langopts.max_roman = 899;
- tr->langopts.min_roman = 1;
- SetLetterVowel(tr,'y');
- tr->langopts.spelling_stress = 1;
- SetLengthMods(tr,3);
- }
- break;
-
- case L('h','y'):
- {
- static const short stress_lengths_hy[8] = {250, 200, 250, 250, 0, 0, 250, 250};
- static const char hy_vowels[] = {0x31, 0x35, 0x37, 0x38, 0x3b, 0x48, 0x55, 0};
- static const char hy_consonants[] = {0x32,0x33,0x34,0x36,0x39,0x3a,0x3c,0x3d,0x3e,0x3f,
- 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x56,0};
-
- SetupTranslator(tr,stress_lengths_hy,NULL);
- tr->langopts.stress_rule = STRESSPOSN_1R;
-
- tr->letter_bits_offset = OFFSET_ARMENIAN;
- memset(tr->letter_bits,0,sizeof(tr->letter_bits));
- SetLetterBits(tr,LETTERGP_A,hy_vowels);
- SetLetterBits(tr,LETTERGP_VOWEL2,hy_vowels);
- SetLetterBits(tr,LETTERGP_C,hy_consonants);
- tr->langopts.max_initial_consonants = 6;
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED;
-
- }
- break;
-
- case L('i','d'):
- case L('m','s'):
- {
- static const short stress_lengths_id[8] = {160, 200, 180, 180, 0, 0, 220, 240};
- static const unsigned char stress_amps_id[8] = {16,18, 18,18, 20,22, 22,21 };
-
- SetupTranslator(tr,stress_lengths_id,stress_amps_id);
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_ROMAN;
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2;
- tr->langopts.accents = 2;
- }
- break;
-
- case L('i','s'):
- {
- static const short stress_lengths_is[8] = {180,160, 200,200, 0,0, 240,250};
- static const wchar_t is_lettergroup_B[] = {'c','f','h','k','p','t','x',0xfe,0};
-
- SetupTranslator(tr,stress_lengths_is,NULL);
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.stress_flags = S_FINAL_NO_2;
- tr->langopts.param[LOPT_IT_LENGTHEN] = 0x11;
- tr->langopts.param[LOPT_REDUCE] = 2;
-
- ResetLetterBits(tr,0x18);
- SetLetterBits(tr,4,"kpst");
- SetLetterBits(tr,3,"jvr");
- tr->letter_groups[1] = is_lettergroup_B;
- SetLetterVowel(tr,'y');
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_SINGLE_AND | NUM_HUNDRED_AND | NUM_AND_UNITS | NUM_1900;
- tr->langopts.numbers2 = 0x2;
- }
- break;
-
- case L('i','t'):
- {
- static const short stress_lengths_it[8] = {150, 140, 170, 170, 0, 0, 300, 330};
- static const unsigned char stress_amps_it[8] = {15,14, 19,19, 20,22, 22,20 };
-
- SetupTranslator(tr,stress_lengths_it,stress_amps_it);
-
- tr->langopts.length_mods0 = tr->langopts.length_mods;
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.stress_flags = S_FINAL_NO_2 | S_PRIORITY_STRESS;
- tr->langopts.vowel_pause = 1;
- tr->langopts.unstressed_wd1 = 2;
- tr->langopts.unstressed_wd2 = 2;
- tr->langopts.param[LOPT_IT_LENGTHEN] = 2;
- tr->langopts.param[LOPT_IT_DOUBLING] = 2;
- tr->langopts.param[LOPT_SONORANT_MIN] = 130;
- tr->langopts.param[LOPT_REDUCE] = 1;
- tr->langopts.param[LOPT_ALT] = 2;
- tr->langopts.numbers = NUM_SINGLE_VOWEL | NUM_OMIT_1_HUNDRED |NUM_DECIMAL_COMMA | NUM_ROMAN | NUM_DFRACTION_1;
- tr->langopts.accents = 2;
- SetLetterVowel(tr,'y');
- }
- break;
-
- case L_jbo:
- {
- static const short stress_lengths_jbo[8] = {145,145, 170,160, 0,0, 330,350};
- static const wchar_t jbo_punct_within_word[] = {'.',',','\'',0x2c8,0};
-
- SetupTranslator(tr,stress_lengths_jbo,NULL);
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.vowel_pause = 0x20c;
-
- tr->punct_within_word = jbo_punct_within_word;
- tr->langopts.param[LOPT_CAPS_IN_WORD] = 2;
- SetLetterVowel(tr,'y');
- tr->langopts.max_lengthmod = 368;
- }
- break;
-
- case L('k','a'):
- {
-
- static const char ka_vowels[] = {0x30,0x34,0x38,0x3d,0x43,0x55,0x57,0};
- static const char ka_consonants[] =
- {0x31,0x32,0x33,0x35,0x36,0x37,0x39,0x3a,0x3b,0x3c,0x3e,0x3f,0x40,0x41,0x42,0x44,
- 0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x56,0};
- SetupTranslator(tr,stress_lengths_ta,stress_amps_ta);
- memset(tr->letter_bits,0,sizeof(tr->letter_bits));
- SetLetterBits(tr,LETTERGP_A,ka_vowels);
- SetLetterBits(tr,LETTERGP_C,ka_consonants);
- SetLetterBits(tr,LETTERGP_VOWEL2,ka_vowels);
-
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.stress_flags = S_FINAL_NO_2;
- tr->letter_bits_offset = OFFSET_GEORGIAN;
-
- 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 | NUM_ROMAN;
-
- tr->langopts.alt_alphabet = OFFSET_CYRILLIC;
- tr->langopts.alt_alphabet_lang = L('r','u');
- }
- break;
-
- case L('k','k'):
- {
- static const unsigned char stress_amps_tr[8] = {18,16, 20,21, 20,21, 21,20 };
- static const short stress_lengths_tr[8] = {190,180, 230,230, 0,0, 250,250};
-
- tr->letter_bits_offset = OFFSET_CYRILLIC;
- memset(tr->letter_bits,0,sizeof(tr->letter_bits));
- SetLetterBits(tr,LETTERGP_A,(char *)ru_vowels);
- SetLetterBits(tr,LETTERGP_C,(char *)ru_consonants);
- SetLetterBits(tr,LETTERGP_VOWEL2,(char *)ru_vowels);
-
- SetupTranslator(tr,stress_lengths_tr,stress_amps_tr);
-
- tr->langopts.stress_rule = 7;
- tr->langopts.stress_flags = S_NO_AUTO_2 + S_NO_EOC_LENGTHEN;
- tr->langopts.lengthen_tonic = 0;
- tr->langopts.param[LOPT_SUFFIX] = 1;
-
- tr->langopts.numbers = NUM_OMIT_1_HUNDRED | NUM_DFRACTION_6 ;
- tr->langopts.max_initial_consonants = 2;
- SetLengthMods(tr,3);
- }
- break;
-
- case L('k','l'):
- {
- SetupTranslator(tr,stress_lengths_equal,stress_amps_equal);
- tr->langopts.stress_rule = 12;
- tr->langopts.stress_flags = S_NO_AUTO_2;
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_SWAP_TENS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_ORDINAL_DOT | NUM_1900 | NUM_ROMAN | NUM_ROMAN_CAPITALS | NUM_ROMAN_ORDINAL;
- }
- break;
-
- case L('k','o'):
- {
- static const char ko_ivowels[] = {0x63,0x64,0x67,0x68,0x6d,0x72,0x74,0x75,0};
- static const unsigned char ko_voiced[] = {0x02,0x05,0x06,0xab,0xaf,0xb7,0xbc,0};
-
- tr->letter_bits_offset = OFFSET_KOREAN;
- memset(tr->letter_bits,0,sizeof(tr->letter_bits));
- SetLetterBitsRange(tr,LETTERGP_A,0x61,0x75);
- SetLetterBits(tr,LETTERGP_Y,ko_ivowels);
- SetLetterBits(tr,LETTERGP_G,(const char *)ko_voiced);
-
- tr->langopts.stress_rule = 8;
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1;
- tr->langopts.numbers = NUM_OMIT_1_HUNDRED;
- tr->langopts.numbers2 = NUM2_MYRIADS;
- tr->langopts.break_numbers = 0x1111110;
- tr->langopts.max_digits = 20;
- }
- break;
-
- case L('k','u'):
- {
- static const unsigned char stress_amps_ku[8] = {18,18, 20,20, 20,22, 22,21 };
- static const short stress_lengths_ku[8] = {180,180, 190,180, 0,0, 230,240};
-
- SetupTranslator(tr,stress_lengths_ku,stress_amps_ku);
- tr->charset_a0 = charsets[9];
-
- tr->langopts.stress_rule = 7;
-
- tr->langopts.numbers = NUM_HUNDRED_AND | NUM_AND_UNITS | NUM_OMIT_1_HUNDRED | NUM_AND_HUNDRED;
- tr->langopts.max_initial_consonants = 2;
- }
- break;
-
- case L('l','a'):
- {
- tr->charset_a0 = charsets[4];
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.stress_flags = S_NO_AUTO_2;
- tr->langopts.unstressed_wd1 = 0;
- tr->langopts.unstressed_wd2 = 2;
- tr->langopts.param[LOPT_DIERESES] = 1;
- tr->langopts.numbers = NUM_ROMAN;
- tr->langopts.max_roman = 5000;
- }
- break;
-
- case L('l','t'):
- {
- tr->charset_a0 = charsets[4];
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.stress_flags = S_NO_AUTO_2;
- tr->langopts.unstressed_wd1 = 0;
- tr->langopts.unstressed_wd2 = 2;
- tr->langopts.param[LOPT_DIERESES] = 1;
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_4 | NUM_ORDINAL_DOT;
- tr->langopts.numbers2 = NUM2_THOUSANDS_VAR4;
- tr->langopts.max_roman = 5000;
- }
- break;
-
- case L('l','v'):
- {
- static const unsigned char stress_amps_lv[8] = {17,13, 20,20, 20,22, 22,21 };
- static const short stress_lengths_lv[8] = {180,130, 210,210, 0,0, 210,210};
-
- SetupTranslator(tr,stress_lengths_lv,stress_amps_lv);
-
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.spelling_stress = 1;
- tr->charset_a0 = charsets[4];
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED | NUM_DFRACTION_4 | NUM_ORDINAL_DOT;
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_EO_CLAUSE1;
- }
- break;
-
- case L('m','k'):
- {
- static wchar_t vowels_cyrillic[] = {0x440,
- 0x430,0x435,0x438,0x439,0x43e,0x443,0x44b,0x44d,0x44e,0x44f,0x450,0x451,0x456,0x457,0x45d,0x45e,0};
- static const unsigned char stress_amps_mk[8] = {17,17, 20,20, 20,22, 22,21 };
- static const short stress_lengths_mk[8] = {180,160, 200,200, 0,0, 220,230};
-
- SetupTranslator(tr,stress_lengths_mk,stress_amps_mk);
- tr->charset_a0 = charsets[5];
- tr->letter_groups[0] = tr->letter_groups[7] = vowels_cyrillic;
-
- tr->langopts.stress_rule = STRESSPOSN_3R;
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_AND_UNITS | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND | NUM_DFRACTION_2;
- tr->langopts.numbers2 = 0x8a;
- }
- break;
-
- case L('m','t'):
- {
- tr->charset_a0 = charsets[3];
- tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x100;
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.numbers = 1;
- }
- break;
-
- case L('n','l'):
- {
- static const short stress_lengths_nl[8] = {160,135, 210,210, 0, 0, 260,280};
-
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.vowel_pause = 0x30;
- tr->langopts.param[LOPT_DIERESES] = 1;
- tr->langopts.param[LOPT_PREFIXES] = 1;
- tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x100;
- SetLetterVowel(tr,'y');
-
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_SWAP_TENS | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND | NUM_ALLOW_SPACE | NUM_1900 | NUM_ORDINAL_DOT;
- tr->langopts.ordinal_indicator = "e";
- tr->langopts.stress_flags = S_FIRST_PRIMARY;
- memcpy(tr->stress_lengths,stress_lengths_nl,sizeof(tr->stress_lengths));
- }
- break;
-
- case L('n','o'):
- {
- static const short stress_lengths_no[8] = {160,140, 200,200, 0,0, 220,230};
-
- SetupTranslator(tr,stress_lengths_no,NULL);
- tr->langopts.stress_rule = STRESSPOSN_1L;
- SetLetterVowel(tr,'y');
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_HUNDRED_AND | NUM_ALLOW_SPACE | NUM_1900 | NUM_ORDINAL_DOT;
- }
- break;
-
- case L('o','m'):
- {
- static const unsigned char stress_amps_om[] = {18,15, 20,20, 20,22, 22,22 };
- static const short stress_lengths_om[8] = {200,200, 200,200, 0,0, 200,200};
-
- SetupTranslator(tr,stress_lengths_om,stress_amps_om);
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2 | 0x80000;
- }
- break;
-
- case L('p','l'):
- {
- static const short stress_lengths_pl[8] = {160, 190, 175, 175, 0, 0, 200, 210};
- static const unsigned char stress_amps_pl[8] = {17,13, 19,19, 20,22, 22,21 };
-
- SetupTranslator(tr,stress_lengths_pl,stress_amps_pl);
-
- tr->charset_a0 = charsets[2];
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY;
- tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x9;
- tr->langopts.max_initial_consonants = 7;
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_DFRACTION_2;
- tr->langopts.numbers2 = NUM2_THOUSANDS_VAR3;
- tr->langopts.param[LOPT_COMBINE_WORDS] = 4 + 0x100;
- SetLetterVowel(tr,'y');
- }
- break;
-
- case L('p','t'):
- {
- static const short stress_lengths_pt[8] = {170, 115, 210, 240, 0, 0, 260, 280};
- static const unsigned char stress_amps_pt[8] = {16,11, 19,21, 20,22, 22,21 };
-
- SetupTranslator(tr,stress_lengths_pt,stress_amps_pt);
- tr->langopts.length_mods0 = tr->langopts.length_mods;
-
- tr->langopts.stress_rule = STRESSPOSN_1R;
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_INITIAL_2 | S_PRIORITY_STRESS;
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_DFRACTION_2 | NUM_HUNDRED_AND | NUM_AND_UNITS | NUM_ROMAN;
- tr->langopts.numbers2 = NUM2_MULTIPLE_ORDINAL | NUM2_NO_TEEN_ORDINALS | NUM2_ORDINAL_NO_AND;
- SetLetterVowel(tr,'y');
- ResetLetterBits(tr,0x2);
- SetLetterBits(tr,1,"bcdfgjkmnpqstvxz");
- tr->langopts.param[LOPT_ALT] = 2;
- }
- break;
-
- case L('r','o'):
- {
- static const short stress_lengths_ro[8] = {170, 170, 180, 180, 0, 0, 240, 260};
- static const unsigned char stress_amps_ro[8] = {15,13, 18,18, 20,22, 22,21 };
-
- SetupTranslator(tr,stress_lengths_ro,stress_amps_ro);
-
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.stress_flags = S_FINAL_STRESS_C + S_FINAL_DIM_ONLY;
-
- tr->charset_a0 = charsets[2];
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_DFRACTION_3 | NUM_AND_UNITS | NUM_ROMAN;
- tr->langopts.numbers2 = 0x1e;
- }
- break;
-
- case L('r','u'):
- Translator_Russian(tr);
- break;
-
- case L('r','w'):
- {
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2;
- tr->langopts.length_mods0 = tr->langopts.length_mods;
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1;
- tr->langopts.numbers = NUM_HUNDRED_AND | NUM_AND_UNITS | NUM_DFRACTION_2 | NUM_AND_HUNDRED;
- tr->langopts.numbers2 = 0x200;
- }
- break;
-
- case L('s','k'):
- case L('c','s'):
- {
- static const char *sk_voiced = "bdgjlmnrvwzaeiouy";
-
- SetupTranslator(tr,stress_lengths_sk,stress_amps_sk);
- tr->charset_a0 = charsets[2];
-
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2;
- tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x3;
- tr->langopts.max_initial_consonants = 5;
- tr->langopts.spelling_stress = 1;
- tr->langopts.param[LOPT_COMBINE_WORDS] = 4;
-
- tr->langopts.numbers = NUM_OMIT_1_HUNDRED | NUM_DFRACTION_2 | NUM_ROMAN;
- tr->langopts.numbers2 = NUM2_THOUSANDS_VAR2;
- tr->langopts.thousands_sep = STRESSPOSN_1L;
- tr->langopts.decimal_sep = ',';
-
- if(name2 == L('c','s'))
- {
- tr->langopts.numbers2 = 0x108;
- }
-
- SetLetterVowel(tr,'y');
- SetLetterVowel(tr,'r');
- ResetLetterBits(tr,0x20);
- SetLetterBits(tr,5,sk_voiced);
- }
- break;
-
- case L('s','i'):
- {
- SetupTranslator(tr,stress_lengths_ta,stress_amps_ta);
- tr->langopts.length_mods0 = tr->langopts.length_mods;
-
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2;
- tr->langopts.spelling_stress = 1;
-
- tr->letter_bits_offset = OFFSET_SINHALA;
- memset(tr->letter_bits,0,sizeof(tr->letter_bits));
- SetLetterBitsRange(tr,LETTERGP_A,0x05,0x16);
- SetLetterBitsRange(tr,LETTERGP_A,0x4a,0x73);
-
- SetLetterBitsRange(tr,LETTERGP_B,0x4a,0x73);
-
- SetLetterBitsRange(tr,LETTERGP_C,0x1a,0x46);
-
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1;
- tr->langopts.suffix_add_e = tr->letter_bits_offset + 0x4a;
- tr->langopts.numbers = NUM_OMIT_1_THOUSAND | NUM_SINGLE_STRESS_L | NUM_DFRACTION_7;
- tr->langopts.numbers2 = NUM2_PERCENT_BEFORE;
- tr->langopts.break_numbers = 0x14aa8;
- }
- break;
-
- case L('s','l'):
- tr->charset_a0 = charsets[2];
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.stress_flags = S_NO_AUTO_2;
- tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 0x103;
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 0x76;
- tr->letter_bits['r'] |= 0x80;
- 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;
- tr->langopts.thousands_sep = ' ';
- break;
-
- case L('s','q'):
- {
- static const short stress_lengths_sq[8] = {150, 150, 180, 180, 0, 0, 300, 300};
- static const unsigned char stress_amps_sq[8] = {16,12, 16,16, 20,20, 21,19 };
-
- SetupTranslator(tr,stress_lengths_sq,stress_amps_sq);
-
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_FINAL_STRESS_C;
- SetLetterVowel(tr,'y');
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_HUNDRED_AND | NUM_AND_UNITS | NUM_DFRACTION_4;
- tr->langopts.accents = 2;
- }
- break;
-
-
- case L('s','v'):
- {
- static const unsigned char stress_amps_sv[] = {16,16, 20,20, 20,22, 22,21 };
- static const short stress_lengths_sv[8] = {160,135, 220,220, 0,0, 250,280};
- SetupTranslator(tr,stress_lengths_sv,stress_amps_sv);
-
- tr->langopts.stress_rule = STRESSPOSN_1L;
- SetLetterVowel(tr,'y');
- tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_1900;
- tr->langopts.accents = 1;
- }
- break;
-
- case L('s','w'):
- case L('t','n'):
- {
- static const short stress_lengths_sw[8] = {160, 170, 200, 200, 0, 0, 320, 340};
- static const unsigned char stress_amps_sw[] = {16,12, 19,19, 20,22, 22,21 };
-
- SetupTranslator(tr,stress_lengths_sw,stress_amps_sw);
- tr->langopts.length_mods0 = tr->langopts.length_mods;
-
- tr->langopts.vowel_pause = 1;
- tr->langopts.stress_rule = STRESSPOSN_2R;
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2;
- tr->langopts.max_initial_consonants = 4;
-
-
- tr->langopts.numbers = NUM_AND_UNITS | NUM_HUNDRED_AND | NUM_SINGLE_AND | NUM_OMIT_1_HUNDRED;
- tr->langopts.break_numbers = 0x49249268;
- }
- break;
-
- case L('t','a'):
- case L('m','l'):
- case L('k','n'):
- case L('m','r'):
- case L('t','e'):
- {
- SetupTranslator(tr,stress_lengths_ta2, stress_amps_ta);
- tr->langopts.length_mods0 = tr->langopts.length_mods;
-
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.stress_flags = S_FINAL_DIM_ONLY;
- tr->langopts.spelling_stress = 1;
- tr->langopts.break_numbers = 0x14a8;
-
- if(name2 == L('t','a'))
- {
- SetupTranslator(tr,stress_lengths_ta, NULL);
- tr->letter_bits_offset = OFFSET_TAMIL;
- tr->langopts.numbers = NUM_OMIT_1_THOUSAND ;
- tr->langopts.param[LOPT_WORD_MERGE] = 1;
- }
- else
- if(name2 == L('m','r'))
- {
- tr->letter_bits_offset = OFFSET_DEVANAGARI;
- }
- else
- if(name2 == L('m','l'))
- {
- tr->letter_bits_offset = OFFSET_MALAYALAM;
- tr->langopts.numbers = NUM_OMIT_1_THOUSAND;
- }
- else
- if(name2 == L('k','n'))
- {
- tr->letter_bits_offset = OFFSET_KANNADA;
- tr->langopts.numbers = 0x1;
- }
- else
- if(name2 == L('t','e'))
- {
- tr->letter_bits_offset = OFFSET_TELUGU;
- tr->langopts.numbers = 0x1;
- }
- SetIndicLetters(tr);
- SetLetterBitsRange(tr,LETTERGP_B,0x4e,0x4e);
- }
- break;
-
- #ifdef deleted
- case L('t','h'):
- {
- static const short stress_lengths_th[8] = {230,150, 230,230, 230,0, 230,250};
- static const unsigned char stress_amps_th[] = {22,16, 22,22, 22,22, 22,22 };
-
- SetupTranslator(tr,stress_lengths_th,stress_amps_th);
-
- tr->langopts.stress_rule = 0;
- tr->langopts.stress_flags = S_NO_DIM;
- tr->langopts.tone_language = 1;
- tr->langopts.length_mods0 = tr->langopts.length_mods;
-
- tr->langopts.word_gap = 0x21;
- }
- break;
- #endif
-
- case L('t','r'):
- case L('a','z'):
- {
- static const unsigned char stress_amps_tr[8] = {18,16, 20,21, 20,21, 21,20 };
- static const short stress_lengths_tr[8] = {190,180, 200,230, 0,0, 240,250};
-
- SetupTranslator(tr,stress_lengths_tr,stress_amps_tr);
- tr->charset_a0 = charsets[9];
-
- tr->langopts.stress_rule = 7;
- tr->langopts.stress_flags = S_NO_AUTO_2;
- tr->langopts.param[LOPT_SUFFIX] = 1;
-
- if(name2 == L('a','z'))
- {
- tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_DECIMAL_COMMA | NUM_ALLOW_SPACE | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND | NUM_DFRACTION_2;
- }
- else
- {
- tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND | NUM_DFRACTION_2;
- }
- tr->langopts.max_initial_consonants = 2;
- }
- break;
-
- case L('t','t'):
- {
- SetCyrillicLetters(tr);
- SetupTranslator(tr,stress_lengths_fr,stress_amps_fr);
- tr->langopts.stress_rule = STRESSPOSN_1R;
- tr->langopts.stress_flags = S_NO_AUTO_2;
- tr->langopts.numbers = NUM_SINGLE_STRESS | NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND | NUM_DFRACTION_4;
- }
- break;
-
- case L('u','k'):
- {
- SetCyrillicLetters(tr);
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 0x432;
- }
- break;
-
- case L('u','r'):
- {
- tr->letter_bits_offset = OFFSET_ARABIC;
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1;
- tr->langopts.numbers = NUM_SWAP_TENS;
- tr->langopts.break_numbers = 0x52a8;
- }
- break;
-
- case L('v','i'):
- {
- static const short stress_lengths_vi[8] = {150, 150, 180, 180, 210, 230, 230, 240};
- static const unsigned char stress_amps_vi[] = {16,16, 16,16, 22,22, 22,22 };
- static wchar_t vowels_vi[] = {
- 0x61, 0xe0, 0xe1, 0x1ea3, 0xe3, 0x1ea1,
- 0x103, 0x1eb1, 0x1eaf, 0x1eb3, 0x1eb5, 0x1eb7,
- 0xe2, 0x1ea7, 0x1ea5, 0x1ea9, 0x1eab, 0x1ead,
- 0x65, 0xe8, 0xe9, 0x1ebb, 0x1ebd, 0x1eb9,
- 0xea, 0x1ec1, 0x1ebf, 0x1ec3, 0x1ec5, 0x1ec7,
- 0x69, 0xec, 0xed, 0x1ec9, 0x129, 0x1ecb,
- 0x6f, 0xf2, 0xf3, 0x1ecf, 0xf5, 0x1ecd,
- 0xf4, 0x1ed3, 0x1ed1, 0x1ed5, 0x1ed7, 0x1ed9,
- 0x1a1, 0x1edd, 0x1edb, 0x1edf, 0x1ee1, 0x1ee3,
- 0x75, 0xf9, 0xfa, 0x1ee7, 0x169, 0x1ee5,
- 0x1b0, 0x1eeb, 0x1ee9, 0x1eed, 0x1eef, 0x1ef1,
- 0x79, 0x1ef3, 0xfd, 0x1ef7, 0x1ef9, 0x1ef5, 0 };
-
- SetupTranslator(tr,stress_lengths_vi,stress_amps_vi);
- tr->langopts.length_mods0 = tr->langopts.length_mods;
-
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.word_gap = 0x21;
-
- tr->letter_groups[0] = tr->letter_groups[7] = vowels_vi;
- tr->langopts.tone_language = 1;
- tr->langopts.unstressed_wd1 = 2;
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_HUNDRED_AND_DIGIT | NUM_DFRACTION_4 | NUM_ZERO_HUNDRED;
-
- }
- break;
-
- case L('w','o'):
- tr->langopts.stress_rule = STRESSPOSN_1L;
- tr->langopts.numbers = NUM_AND_UNITS | NUM_HUNDRED_AND | NUM_OMIT_1_HUNDRED | NUM_OMIT_1_THOUSAND | NUM_SINGLE_STRESS;
- break;
-
- case L('z','h'):
- case L_zhy:
- {
- static const short stress_lengths_zh[8] = {230,150, 230,230, 230,0, 240,250};
- static const unsigned char stress_amps_zh[] = {22,16, 22,22, 22,22, 22,22 };
-
- SetupTranslator(tr,stress_lengths_zh,stress_amps_zh);
-
- tr->langopts.stress_rule = STRESSPOSN_1R;
- tr->langopts.stress_flags = S_NO_DIM;
- tr->langopts.vowel_pause = 0;
- tr->langopts.tone_language = 1;
- tr->langopts.length_mods0 = tr->langopts.length_mods;
- tr->langopts.tone_numbers = 1;
- tr->langopts.ideographs = 1;
- tr->langopts.word_gap = 0x21;
- if(name2 == L('z','h'))
- {
- tr->langopts.textmode = 1;
- tr->langopts.listx = 1;
- }
- }
- break;
-
- default:
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1;
- break;
- }
-
- tr->translator_name = name2;
-
- if(tr->langopts.numbers & NUM_DECIMAL_COMMA)
- {
-
- tr->langopts.thousands_sep = '.';
- tr->langopts.decimal_sep = ',';
- }
- if(tr->langopts.numbers & NUM_THOUS_SPACE)
- {
- tr->langopts.thousands_sep = 0;
- }
-
- return(tr);
- }
-
-
-
-
-
-
-
-
- static void Translator_Russian(Translator *tr)
- {
- static const unsigned char stress_amps_ru[] = {16,16, 18,18, 20,24, 24,22 };
- static const short stress_lengths_ru[8] = {150,140, 220,220, 0,0, 260,280};
- static const char ru_ivowels2[] = {0x2c,0x15,0x18,0x2e,0x2f,0};
-
- SetupTranslator(tr,stress_lengths_ru,stress_amps_ru);
- SetCyrillicLetters(tr);
- SetLetterBits(tr,6,ru_ivowels2);
-
- tr->langopts.param[LOPT_UNPRONOUNCABLE] = 0x432;
- tr->langopts.param[LOPT_REGRESSIVE_VOICING] = 1;
- tr->langopts.param[LOPT_REDUCE] = 2;
- tr->langopts.stress_rule = 5;
- tr->langopts.stress_flags = S_NO_AUTO_2;
-
- tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_OMIT_1_HUNDRED;
- tr->langopts.numbers2 = 0x2 + NUM2_THOUSANDS_VAR1;
- tr->langopts.phoneme_change = 1;
- tr->langopts.testing = 2;
-
- }
-
-
-
-
-
-
-
- #ifdef RUSSIAN2
-
-
- int ChangePhonemes_ru(Translator *tr, PHONEME_LIST2 *phlist, int n_ph, int index, PHONEME_TAB *ph, CHANGEPH *ch)
- {
-
-
-
- int variant;
- int vowelix;
- PHONEME_TAB *prev, *next;
-
- if(ch->flags & 8)
- return(0);
-
-
- if(ph->type == phVOWEL)
- {
- int prestressed = ch->vowel_stressed==ch->vowel_this+1;
-
- #define N_VOWELS_RU 11
- static unsigned int vowels_ru[N_VOWELS_RU] = {'a','V','O','I',PH('I','#'),PH('E','#'),PH('E','2'),
- PH('V','#'),PH('I','3'),PH('I','2'),PH('E','3')};
-
-
- static unsigned int vowel_replace[N_VOWELS_RU][6] = {
-
- {'A', 'I', PH('j','a'), 'a', 'a', 'a'},
- {'A', 'V', PH('j','a'), 'a', 'V', 'a'},
- {'o', '8', '8', 'o', '8', '8'},
- {'i', 'I', 'i', 'a', 'I', 'a'},
- {'i', PH('I','#'), 'i', 'i', PH('I','#'), 'i'},
- {'E', PH('E','#'), 'E', 'e', PH('E','#'), 'e'},
- {'E', PH('E','2'), 'E', 'e', PH('E','2'), 'e'},
- {PH('j','a'), 'V', PH('j','a'), 'A', 'V', 'A'},
- {PH('j','a'), 'I', PH('j','a'), 'e', 'I', 'e'},
- {'e', 'I', 'e', 'e', 'I', 'e'},
- {'e', PH('E', '2'), 'e', 'e', PH('E','2'), 'e'}
- };
-
- prev = phoneme_tab[phlist[index-1].phcode];
- next = phoneme_tab[phlist[index+1].phcode];
-
-
- for(vowelix=0; vowelix<N_VOWELS_RU; vowelix++)
- {
- if(vowels_ru[vowelix] == ph->mnemonic)
- break;
- }
- if(vowelix == N_VOWELS_RU)
- return(0);
-
- if(prestressed)
- {
- if((vowelix==6)&&(prev->mnemonic=='j'))
- vowelix=8;
- if(vowelix==1)
- vowelix=0;
- if(vowelix==4)
- vowelix=3;
- if(vowelix==6)
- vowelix=5;
- if(vowelix==7)
- vowelix=8;
- if(vowelix==10)
- vowelix=9;
- }
-
- variant = -1;
- int stressed = ch->flags & 2;
- int soft=prev->phflags & phPALATAL;
-
- if (soft && stressed)
- variant = 2; else
- if (stressed)
- variant = 0; else
- if (soft)
- variant = 1;
- if(variant >= 0)
- {
- if(prev->mnemonic == 'j')
- variant += 3;
-
- phlist[index].phcode = PhonemeCode(vowel_replace[vowelix][variant]);
- }
- else
- {
- phlist[index].phcode = PhonemeCode(vowels_ru[vowelix]);
- }
- }
-
- return(0);
- }
-
- #endif
|