Merge branch 'upstream' into development

Conflicts:
	dictsource/dict_phonemes
	phsource/compile_report
This commit is contained in:
Reece H. Dunn
2013-04-08 21:19:02 +01:00
22 changed files with 279 additions and 148 deletions
+6 -1
View File
@@ -2727,7 +2727,6 @@ static void DecThenCount()
static void InstnPlusPhoneme(int instn)
{//====================================
int phcode;
DecThenCount();
phcode = NextItemBrackets(tPHONEMEMNEM,0);
*prog_out++ = instn + phcode;
@@ -2835,16 +2834,19 @@ int CompilePhoneme(int compile_phoneme)
case i_CHANGE_IF+2:
case i_CHANGE_IF+3:
InstnPlusPhoneme(keyword << 8);
DecThenCount();
break;
case i_PAUSE_BEFORE:
value = NextItemMax(255);
*prog_out++ = (i_PAUSE_BEFORE << 8) + value;
DecThenCount();
break;
case i_PAUSE_AFTER:
value = NextItemMax(255);
*prog_out++ = (i_PAUSE_AFTER << 8) + value;
DecThenCount();
break;
case i_SET_LENGTH:
@@ -2936,6 +2938,7 @@ int CompilePhoneme(int compile_phoneme)
{
*prog_out++ = (ipa_buf[ix+start] << 8) + (ipa_buf[ix+start+1] & 0xff);
}
DecThenCount();
break;
}
break;
@@ -3018,6 +3021,7 @@ int CompilePhoneme(int compile_phoneme)
case kCALLPH:
CallPhoneme();
DecThenCount();
break;
case kFMT:
@@ -3049,6 +3053,7 @@ int CompilePhoneme(int compile_phoneme)
break;
case kTONESPEC:
DecThenCount();
endphoneme = CompileToneSpec();
break;
+12 -7
View File
@@ -653,13 +653,15 @@ void GetTranslatedPhonemeString(char *phon_out, int n_phon_out, int use_ipa)
static const char *stress_chars = "==,,''";
static const int char_tie[] = {0x0361, 0x200d}; // combining-double-inverted-breve, zero-width-joiner
if(use_ipa == 4)
if(use_ipa >= 4)
{
// separate individual phonemes with underscores
use_ipa = 1;
separate_phonemes = '_';
if(use_ipa == 5)
use_ipa = 0;
else
use_ipa = 1;
}
if(phon_out != NULL)
{
for(ix=1; ix<(n_phoneme_list-2); ix++)
@@ -698,8 +700,8 @@ void GetTranslatedPhonemeString(char *phon_out, int n_phon_out, int use_ipa)
if(c != 0)
{
buf += utf8_out(c, buf);
if(separate_phonemes)
*buf++ = separate_phonemes;
// if(separate_phonemes)
// *buf++ = separate_phonemes;
}
}
}
@@ -1637,8 +1639,11 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags,
if(!(control & 1) && ((ph = phoneme_tab[*p]) != NULL))
{
if(ph->type == phSTRESS)
ph = phoneme_tab[p[1]];
while((ph->type == phSTRESS) || (*p == phonEND_WORD))
{
p++;
ph = phoneme_tab[p[0]];
}
#ifdef deleted
int gap = tr->langopts.word_gap & 0x700;
+11 -7
View File
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#ifndef NEED_GETOPT
#include <getopt.h>
#endif
@@ -221,14 +222,17 @@ int OpenWavFile(char *path, int rate)
if(path == NULL)
return(2);
if(path[0] == 0)
return(0);
if(strcmp(path,"stdout")==0)
f_wavfile = stdout;
else
f_wavfile = fopen(path,"wb");
while(isspace(*path)) path++;
f_wavfile = NULL;
if(path[0] != 0)
{
if(strcmp(path,"stdout")==0)
f_wavfile = stdout;
else
f_wavfile = fopen(path,"wb");
}
if(f_wavfile == NULL)
{
fprintf(stderr,"Can't write to: '%s'\n",path);
+4
View File
@@ -71,6 +71,8 @@ static int ssml_ignore_l_angle = 0;
// punctuations symbols that can end a clause
static const unsigned short punct_chars[] = {',','.','?','!',':',';',
0x00a1, // inverted exclamation
0x00bf, // inverted question
0x2013, // en-dash
0x2014, // em-dash
0x2026, // elipsis
@@ -119,6 +121,8 @@ static const unsigned short punct_chars[] = {',','.','?','!',':',';',
// bits 0-7 pause x 10mS, bits 12-14 intonation type, bit 15 don't need following space or bracket
static const unsigned int punct_attributes [] = { 0,
CLAUSE_COMMA, CLAUSE_PERIOD, CLAUSE_QUESTION, CLAUSE_EXCLAMATION, CLAUSE_COLON, CLAUSE_SEMICOLON,
CLAUSE_SEMICOLON | 0x8000, // inverted exclamation
CLAUSE_SEMICOLON | 0x8000, // inverted question
CLAUSE_SEMICOLON, // en-dash
CLAUSE_SEMICOLON, // em-dash
CLAUSE_SEMICOLON | PUNCT_SAY_NAME | 0x8000, // elipsis
+12 -5
View File
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#ifndef PLATFORM_DOS
#ifdef PLATFORM_WINDOWS
@@ -243,16 +244,22 @@ static int OpenWaveFile(const char *path, int rate)
if(path == NULL)
return(2);
if(strcmp(path,"stdout")==0)
while(isspace(*path)) path++;
f_wave = NULL;
if(path[0] != 0)
{
if(strcmp(path,"stdout")==0)
{
#ifdef PLATFORM_WINDOWS
// prevent Windows adding 0x0d before 0x0a bytes
_setmode(_fileno(stdout), _O_BINARY);
_setmode(_fileno(stdout), _O_BINARY);
#endif
f_wave = stdout;
f_wave = stdout;
}
else
f_wave = fopen(path,"wb");
}
else
f_wave = fopen(path,"wb");
if(f_wave != NULL)
{
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.47.04a 05.Apr.13";
const char *version_string = "1.47.05 08.Apr.13";
const int version_phdata = 0x014701;
int option_device_number = -1;