mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-30 22:23:05 +00:00
[1.39.06]
Added languages for possible development: bn, ml Changes to phonemes: [x] [C] hi: [ph] [th] git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@194 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
+1
-1
@@ -35,7 +35,7 @@
|
||||
#include "translate.h"
|
||||
#include "wave.h"
|
||||
|
||||
const char *version_string = "1.39.04 19.Sep.08";
|
||||
const char *version_string = "1.39.05 22.Sep.08";
|
||||
const int version_phdata = 0x013900;
|
||||
|
||||
int option_device_number = -1;
|
||||
|
||||
+22
-15
@@ -46,6 +46,7 @@
|
||||
#define OFFSET_GREEK 0x380
|
||||
#define OFFSET_CYRILLIC 0x420
|
||||
#define OFFSET_DEVANAGARI 0x900
|
||||
#define OFFSET_BENGALI 0x980
|
||||
#define OFFSET_TAMIL 0xb80
|
||||
#define OFFSET_MALAYALAM 0xd00
|
||||
#define OFFSET_KOREAN 0x1100
|
||||
@@ -88,6 +89,20 @@ static const unsigned int replace_cyrillic_latin[] =
|
||||
0}; // ѓ ѕ ќ
|
||||
|
||||
|
||||
void SetIndicLetters(Translator *tr)
|
||||
{
|
||||
// Set letter types for Indic scripts, Devanagari, Tamill, etc
|
||||
static const char dev_consonants2[] = {0x02,0x03,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f};
|
||||
|
||||
memset(tr->letter_bits,0,sizeof(tr->letter_bits));
|
||||
SetLetterBitsRange(tr,LETTERGP_A,0x04,0x14); // vowel letters
|
||||
SetLetterBitsRange(tr,LETTERGP_A,0x3e,0x4c); // vowel signs
|
||||
SetLetterBitsRange(tr,LETTERGP_B,0x3e,0x4d); // vowel signs, and virama
|
||||
SetLetterBitsRange(tr,LETTERGP_C,0x15,0x39); // the main consonant range
|
||||
SetLetterBits(tr,LETTERGP_C,dev_consonants2); // additional consonants
|
||||
tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words
|
||||
}
|
||||
|
||||
void SetupTranslator(Translator *tr, const short *lengths, const unsigned char *amps)
|
||||
{//==================================================================================
|
||||
if(lengths != NULL)
|
||||
@@ -313,7 +328,6 @@ Translator *SelectTranslator(const char *name)
|
||||
|
||||
case L('h','i'):
|
||||
{
|
||||
static const char dev_consonants2[] = {0x02,0x03,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f};
|
||||
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,24, 24,22 };
|
||||
|
||||
@@ -327,13 +341,7 @@ Translator *SelectTranslator(const char *name)
|
||||
tr->langopts.numbers = 0x011;
|
||||
tr->langopts.numbers2 = 0x100;
|
||||
tr->letter_bits_offset = OFFSET_DEVANAGARI;
|
||||
|
||||
memset(tr->letter_bits,0,sizeof(tr->letter_bits));
|
||||
SetLetterBitsRange(tr,LETTERGP_A,0x06,0x14); // vowel letters
|
||||
SetLetterBitsRange(tr,LETTERGP_B,0x3e,0x4d); // vowel signs + virama
|
||||
SetLetterBitsRange(tr,LETTERGP_C,0x15,0x39); // the main consonant range
|
||||
SetLetterBits(tr,LETTERGP_C,dev_consonants2); // additional consonants
|
||||
tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words
|
||||
SetIndicLetters(tr);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -713,6 +721,7 @@ SetLengthMods(tr,3); // all equal
|
||||
|
||||
case L('t','a'): // Tamil
|
||||
case L('m','l'): // Malayalam
|
||||
case L('b','n'): // Bengali
|
||||
{
|
||||
static const short stress_lengths_ta[8] = {200, 200, 210, 210, 0, 0, 230, 230};
|
||||
static const unsigned char stress_amps_ta[8] = {18,18, 18,18, 20,20, 22,22 };
|
||||
@@ -729,14 +738,12 @@ SetLengthMods(tr,3); // all equal
|
||||
{
|
||||
tr->letter_bits_offset = OFFSET_MALAYALAM;
|
||||
}
|
||||
if(name2 == L('b','n'))
|
||||
{
|
||||
tr->letter_bits_offset = OFFSET_BENGALI;
|
||||
}
|
||||
tr->langopts.param[LOPT_WORD_MERGE] = 1; // don't break vowels betwen words
|
||||
|
||||
memset(tr->letter_bits,0,sizeof(tr->letter_bits));
|
||||
SetLetterBitsRange(tr,LETTERGP_A,0x05,0x14); // vowel letters
|
||||
SetLetterBitsRange(tr,LETTERGP_A,0x3e,0x4c); // vowel signs
|
||||
SetLetterBitsRange(tr,LETTERGP_B,0x3e,0x4d); // vowel signs, and virama
|
||||
SetLetterBitsRange(tr,LETTERGP_C,0x15,0x39); // the main consonant range
|
||||
tr->langopts.param[LOPT_UNPRONOUNCABLE] = 1; // disable check for unpronouncable words
|
||||
SetIndicLetters(tr);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
+12
-10
@@ -361,14 +361,13 @@ int IsAlpha(unsigned int c)
|
||||
if(iswalpha(c))
|
||||
return(1);
|
||||
|
||||
if((c >= 0x901) && (c <= 0x957))
|
||||
return(1); // Devanagari vowel signs and other signs
|
||||
|
||||
if((c >= 0xb81) && (c <= 0xbe5))
|
||||
return(1); // Tamil vowel signs and other signs
|
||||
|
||||
if((c >= 0xd01) && (c <= 0xd57))
|
||||
return(1); // Malayalam vowel signs and other signs
|
||||
if((c >= 0x901) && (c <= 0xdf7))
|
||||
{
|
||||
// Indic scripts: Devanagari, Tamil, etc
|
||||
if((c & 0x7f) < 0x64)
|
||||
return(1);
|
||||
return(0);
|
||||
}
|
||||
|
||||
if((c >= 0x300) && (c <= 0x36f))
|
||||
return(1); // combining accents
|
||||
@@ -1924,6 +1923,7 @@ int Translator::TranslateChar(char *ptr, int prev_in, unsigned int c, unsigned i
|
||||
int initial;
|
||||
int medial;
|
||||
int final;
|
||||
int next2;
|
||||
|
||||
static const unsigned char hangul_compatibility[0x34] = {
|
||||
0, 0x00,0x01,0xaa,0x02,0xac,0xad,0x03,
|
||||
@@ -1938,10 +1938,12 @@ int Translator::TranslateChar(char *ptr, int prev_in, unsigned int c, unsigned i
|
||||
{
|
||||
case L('a','f'):
|
||||
// look for 'n and replace by a special character (unicode: schwa)
|
||||
|
||||
|
||||
utf8_in(&next2, &ptr[1], 0);
|
||||
|
||||
if(!iswalpha(prev_in))
|
||||
{
|
||||
if((c == '\'') && (next_in == 'n') && isspace(ptr[1]))
|
||||
if((c == '\'') && (next_in == 'n') && IsSpace(next2))
|
||||
{
|
||||
// n preceded by either apostrophe or U2019 "right single quotation mark"
|
||||
ptr[0] = ' '; // delete the n
|
||||
|
||||
Reference in New Issue
Block a user