[1.25.18] Adjusted [la], [wi]

Added mechanism to reduce [t] before unstressed vowels (for en-us)
Fixed X (no vowels) operator in pre-rules in *_rules files.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@35 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2007-06-06 16:03:52 +00:00
parent 0fa20438c1
commit bc7ef71556
29 changed files with 465 additions and 205 deletions
+14 -4
View File
@@ -2041,10 +2041,20 @@ void Translator::MatchRule(char *word[], const char *group, char *rule, MatchRec
break;
case RULE_NOVOWELS:
if(word_vowel_count== 0)
match.points += 19;
else
failed =1;
{
char *p = pre_ptr - letter_xbytes - 1;
while(letter_w != RULE_SPACE)
{
if(IsLetter(letter_w,LETTERGP_VOWEL2))
{
failed = 1;
break;
}
p -= utf8_in(&letter_w,p,1);
}
if(!failed)
match.points += (19-distance_left);
}
break;
case RULE_IFVERB:
+1
View File
@@ -77,6 +77,7 @@
#define phonSWITCH 21
#define phonX1 22 // a language specific action
#define phonPAUSE_VSHORT 23
#define phonT_REDUCED 24
// place of articulation
+10 -10
View File
@@ -408,16 +408,16 @@ void Translator::MakePhonemeList(int post_pause, int start_sentence)
}
}
#ifdef deleted
// experimenting with [t] glottaling
if((ph->mnemonic == 't') && ((prev->type == phVOWEL) || (prev->mnemonic == 'n')))
{
if(((plist2+1)->sourceix != 0) || ((plist2-1)->stress == 4) && (next->type == phVOWEL))
{
ph = phoneme_tab[phonGLOTTALSTOP];
}
}
#endif
if(langopts.param[LOPT_REDUCE_T])
{
if((ph->mnemonic == 't') && (plist2->sourceix == 0) && ((prev->type == phVOWEL) || (prev->mnemonic == 'n')))
{
if(((plist2+1)->sourceix == 0) && ((plist2+1)->stress < 4) && (next->type == phVOWEL))
{
ph = phoneme_tab[phonT_REDUCED];
}
}
}
if((ph->reduce_to != 0) && (ph->type != phVOWEL) && !(plist2->synthflags & SFLAG_DICTIONARY))
{
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.25.17 04.Jun.07";
const char *version_string = "1.25.18 06.Jun.07";
const int version_phdata = 0x012514;
int option_device_number = -1;
+6
View File
@@ -652,11 +652,17 @@ static void SmoothSpect(void)
frame = frame2 = (frame_t *)q[2];
modified = 0;
if(frame->frflags & FRFLAG_BREAK)
break;
if(frame->frflags & FRFLAG_FORMANT_RATE)
len = (len * 12)/10; // allow slightly greater rate of change for this frame (was 12/10)
for(pk=0; pk<6; pk++)
{
if((frame->frflags & FRFLAG_BREAK_LF) && (pk < 3))
continue;
allowed = (formant_rate[pk] * len)/256;
diff = frame->ffreq[pk] - frame1->ffreq[pk];
+1
View File
@@ -31,6 +31,7 @@
#define FRFLAG_LEN_MOD 0x04 // reduce effect of length adjustment
#define FRFLAG_BREAK_LF 0x08 // but keep f3 upwards
#define FRFLAG_BREAK 0x10 // don't merge with next frame
#define FRFLAG_BREAK_2 0x18 // FRFLAG_BREAK_LF or FRFLAG_BREAK
#define FRFLAG_FORMANT_RATE 0x20 // Flag5 allow increased rate of change of formant freq
#define FRFLAG_MODULATE 0x40 // Flag6 modulate amplitude of some cycles to give trill
#define FRFLAG_DEFER_WAV 0x80 // Flag7 defer mixing WAV until the next frame
+3 -1
View File
@@ -206,7 +206,7 @@ extern const int param_defaults[N_SPEECH_PARAM];
#define N_LOPTS 12
#define N_LOPTS 13
#define LOPT_DIERESES 1
// 1=remove [:] from unstressed syllables, 2= remove from unstressed or non-penultimate syllables
// bit 4=0, if stress < 4, bit 4=1, if not the highest stress in the word
@@ -235,6 +235,8 @@ extern const int param_defaults[N_SPEECH_PARAM];
// bit 4=only if the second word has $alt attribute
// bit 5=not if the second word is end-of-sentence
#define LOPT_COMBINE_WORDS 11
// change [t] when followed by unstressed vowel
#define LOPT_REDUCE_T 12
typedef struct {