This is not used by any of the espeak-ng voices and languages. Additionally, this functionality would be superceded by support for specifying the language used by different scripts in the language argument on the command line.master
| - [stressAmp](#stressamp) | - [stressAmp](#stressamp) | ||||
| - [intonation](#intonation) | - [intonation](#intonation) | ||||
| - [dictmin](#dictmin) | - [dictmin](#dictmin) | ||||
| - [alphabet2](#alphabet2) | |||||
| ---------- | ---------- | ||||
| installed. If the size of the compiled dictionary data for the language | installed. If the size of the compiled dictionary data for the language | ||||
| (the file `espeak-ng-data/*_dict`) is less than this size then a | (the file `espeak-ng-data/*_dict`) is less than this size then a | ||||
| warning is given. | warning is given. | ||||
| ### alphabet2 | |||||
| alphabet2 <alphabet> <language> | |||||
| Used to specify a language to be used to speak words which are written | |||||
| in a non-native alphabet. e.g.: | |||||
| 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. |
| if ((match1.points == 0) && ((option_sayas & 0x10) == 0)) { | if ((match1.points == 0) && ((option_sayas & 0x10) == 0)) { | ||||
| n = utf8_in(&letter, p-1)-1; | n = utf8_in(&letter, p-1)-1; | ||||
| if (tr->letter_bits_offset > 0) { | |||||
| // not a Latin alphabet, switch to the default Latin alphabet language | |||||
| if ((letter <= 0x241) && iswalpha(letter)) { | |||||
| sprintf(phonemes, "%c%s", phonSWITCH, tr->langopts.ascii_language); | |||||
| return 0; | |||||
| } | |||||
| } | |||||
| // is it a bracket ? | // is it a bracket ? | ||||
| if (letter == 0xe000+'(') { | if (letter == 0xe000+'(') { | ||||
| if (pre_pause < tr->langopts.param2[LOPT_BRACKET_PAUSE]) | if (pre_pause < tr->langopts.param2[LOPT_BRACKET_PAUSE]) |
| { NULL, 0, 0, 0, 0, 0 } | { 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 *AlphabetFromChar(int c) | ||||
| { | { | ||||
| // Find the alphabet from a character. | // Find the alphabet from a character. | ||||
| tr->langopts.param2[LOPT_BRACKET_PAUSE] = 2; // pauses when announcing bracket names | tr->langopts.param2[LOPT_BRACKET_PAUSE] = 2; // pauses when announcing bracket names | ||||
| tr->langopts.max_initial_consonants = 3; | tr->langopts.max_initial_consonants = 3; | ||||
| tr->langopts.replace_chars = NULL; | tr->langopts.replace_chars = NULL; | ||||
| tr->langopts.ascii_language[0] = 0; // Non-Latin alphabet languages, use this language to speak Latin words, default is English | |||||
| tr->langopts.alt_alphabet_lang = L('e', 'n'); | tr->langopts.alt_alphabet_lang = L('e', 'n'); | ||||
| tr->langopts.roman_suffix = utf8_null; | tr->langopts.roman_suffix = utf8_null; | ||||
| int testing; // testing options: bit 1= specify stressed syllable in the form: "outdoor/2" | int testing; // testing options: bit 1= specify stressed syllable in the form: "outdoor/2" | ||||
| int listx; // compile *_listx after *list | int listx; // compile *_listx after *list | ||||
| const unsigned int *replace_chars; // characters to be substitutes | const unsigned int *replace_chars; // characters to be substitutes | ||||
| char ascii_language[8]; // switch to this language for Latin characters | |||||
| int our_alphabet; // offset for main alphabet (if not set in letter_bits_offset) | int our_alphabet; // offset for main alphabet (if not set in letter_bits_offset) | ||||
| int alt_alphabet; // offset for another language to recognize | int alt_alphabet; // offset for another language to recognize | ||||
| int alt_alphabet_lang; // language for the alt_alphabet | int alt_alphabet_lang; // language for the alt_alphabet | ||||
| const char *GetTranslatedPhonemeString(int phoneme_mode); | const char *GetTranslatedPhonemeString(int phoneme_mode); | ||||
| const char *WordToString2(unsigned int word); | const char *WordToString2(unsigned int word); | ||||
| ALPHABET *AlphabetFromChar(int c); | ALPHABET *AlphabetFromChar(int c); | ||||
| ALPHABET *AlphabetFromName(const char *name); | |||||
| Translator *SelectTranslator(const char *name); | Translator *SelectTranslator(const char *name); | ||||
| int SetTranslator2(const char *name); | int SetTranslator2(const char *name); |
| { "fast_test2", V_FAST }, | { "fast_test2", V_FAST }, | ||||
| { "speed", V_SPEED }, | { "speed", V_SPEED }, | ||||
| { "dict_min", V_DICTMIN }, | { "dict_min", V_DICTMIN }, | ||||
| { "alphabet2", V_ALPHABET2 }, | |||||
| // these just set a value in langopts.param[] | // these just set a value in langopts.param[] | ||||
| { "l_dieresis", 0x100+LOPT_DIERESES }, | { "l_dieresis", 0x100+LOPT_DIERESES }, | ||||
| case V_DICTMIN: | case V_DICTMIN: | ||||
| sscanf(p, "%d", &dict_min); | sscanf(p, "%d", &dict_min); | ||||
| break; | 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; | |||||
| case V_MAINTAINER: | case V_MAINTAINER: | ||||
| case V_STATUS: | case V_STATUS: | ||||
| break; | break; |