mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-21 03:24:48 +00:00
[1.45.27]
Lang=hi, Suppress some [@] vowels. Include batch of changes from Jerouris. Fix crash with large number of nbsp characters. git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@266 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
@@ -142,6 +142,8 @@ static keywtab_t k_properties[] = {
|
||||
{"isFinalVowel", 0, i_isFinalVowel},
|
||||
{"isVoiced", 0, i_isVoiced}, // voiced consonant, or vowel
|
||||
{"isFirstVowel", 0, i_isFirstVowel},
|
||||
{"isSecondVowel", 0, i_isSecondVowel},
|
||||
{"isSeqFlag1", 0, i_isSeqFlag1},
|
||||
|
||||
{NULL, 0, 0}
|
||||
};
|
||||
|
||||
+2
-2
@@ -2920,7 +2920,7 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor
|
||||
const char *word_end;
|
||||
const char *word1;
|
||||
int wflags = 0;
|
||||
char word_buf[N_WORD_BYTES];
|
||||
char word_buf[N_WORD_BYTES+1];
|
||||
|
||||
if(wtab != NULL)
|
||||
{
|
||||
@@ -2930,7 +2930,7 @@ static const char *LookupDict2(Translator *tr, const char *word, const char *wor
|
||||
word1 = word;
|
||||
if(tr->transpose_min > 0)
|
||||
{
|
||||
strcpy(word_buf,word);
|
||||
strncpy0(word_buf,word, N_WORD_BYTES);
|
||||
wlen = TransposeAlphabet(tr, word_buf);
|
||||
word = word_buf;
|
||||
}
|
||||
|
||||
+36
-5
@@ -35,7 +35,7 @@
|
||||
#include "translate.h"
|
||||
#include "wave.h"
|
||||
|
||||
const char *version_string = "1.45.23 03.May.11";
|
||||
const char *version_string = "1.45.27 19.May.11";
|
||||
const int version_phdata = 0x014500;
|
||||
|
||||
int option_device_number = -1;
|
||||
@@ -588,6 +588,22 @@ static bool StressCondition(Translator *tr, PHONEME_LIST *plist, int condition,
|
||||
} // end of StressCondition
|
||||
|
||||
|
||||
static int CountVowelPosition(PHONEME_LIST *plist)
|
||||
{//===============================================
|
||||
int count = 0;
|
||||
|
||||
for(;;)
|
||||
{
|
||||
if(plist->ph->type == phVOWEL)
|
||||
count++;
|
||||
if(plist->sourceix != 0)
|
||||
break;
|
||||
plist--;
|
||||
}
|
||||
return(count);
|
||||
} // end of CoundVowelPosition
|
||||
|
||||
|
||||
static bool InterpretCondition(Translator *tr, int control, PHONEME_LIST *plist, int instn)
|
||||
{//========================================================================================
|
||||
int which;
|
||||
@@ -739,19 +755,34 @@ static bool InterpretCondition(Translator *tr, int control, PHONEME_LIST *plist,
|
||||
|
||||
case 12: // isVoiced
|
||||
return((ph->type == phVOWEL) || (ph->type == phLIQUID) || (ph->phflags & phVOICED));
|
||||
}
|
||||
|
||||
case 13: // isFirstVowel
|
||||
return(CountVowelPosition(plist)==1);
|
||||
|
||||
case 14: // isSecondVowel
|
||||
return(CountVowelPosition(plist)==2);
|
||||
|
||||
case 15: // isSeqFlag1
|
||||
// is this preceded by a sequence if 1 or more vowels which have 'flag1' ? (lang=hi)
|
||||
if(plist->sourceix != 0)
|
||||
return(false); // this is the first phoneme in the word, so no.
|
||||
|
||||
count = 0;
|
||||
for(;;)
|
||||
{
|
||||
plist--;
|
||||
if(plist->ph->type == phVOWEL)
|
||||
count++;
|
||||
{
|
||||
if(plist->ph->phflags & phFLAG1)
|
||||
count++;
|
||||
else
|
||||
break; // stop when we find a vowel without flag1
|
||||
}
|
||||
if(plist->sourceix != 0)
|
||||
break;
|
||||
plist--;
|
||||
}
|
||||
return(count==1);
|
||||
return(count > 0);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -327,6 +327,8 @@ typedef struct {
|
||||
#define i_isFinalVowel 0x8b
|
||||
#define i_isVoiced 0x8c
|
||||
#define i_isFirstVowel 0x8d
|
||||
#define i_isSecondVowel 0x8e
|
||||
#define i_isSeqFlag1 0x8f
|
||||
|
||||
// place of articulation
|
||||
#define i_isVel 0x28
|
||||
|
||||
Reference in New Issue
Block a user