Merge branch 'development' into build

Conflicts:
	.gitignore
This commit is contained in:
Reece Dunn
2011-11-18 08:49:19 +00:00
79 changed files with 1961 additions and 265 deletions
+20 -13
View File
@@ -373,6 +373,7 @@ static int compile_line(char *linebuf, char *dict_line, int *hash)
unsigned int ix;
int step;
unsigned int n_flag_codes = 0;
int flagnum;
int flag_offset;
int length;
int multiple_words = 0;
@@ -395,10 +396,6 @@ static char nullstring[] = {0};
text_not_phonemes = 0;
phonetic = word = nullstring;
if(memcmp(linebuf,"_-",2)==0)
{
step=1; // TEST
}
p = linebuf;
// while(isspace2(*p)) p++;
@@ -460,26 +457,26 @@ step=1; // TEST
while(!isspace2(c = *p)) p++;
*p = 0;
ix = LookupMnem(mnem_flags,mnemptr);
if(ix > 0)
flagnum = LookupMnem(mnem_flags,mnemptr);
if(flagnum > 0)
{
if(ix == 200)
if(flagnum == 200)
{
text_mode = 1;
}
else
if(ix == 201)
if(flagnum == 201)
{
text_mode = 0;
}
else
if(ix == BITNUM_FLAG_TEXTMODE)
if(flagnum == BITNUM_FLAG_TEXTMODE)
{
text_not_phonemes = 1;
}
else
{
flag_codes[n_flag_codes++] = ix;
flag_codes[n_flag_codes++] = flagnum;
}
}
else
@@ -539,11 +536,20 @@ step=1; // TEST
}
}
else
if((c == ')') && multiple_words)
if(c == ')')
{
p[0] = 0;
if(multiple_words)
{
p[0] = 0;
multiple_words = 0;
}
else
if(word[0] != '_')
{
fprintf(f_log, "%5d: Missing '('\n", linenum);
error_count++;
}
step = 3;
multiple_words = 0;
}
break;
@@ -720,6 +726,7 @@ step=1; // TEST
if(multiple_words > 10)
{
fprintf(f_log,"%5d: Two many parts in a multi-word entry: %d\n",linenum,multiple_words);
error_count++;
}
else
{
+1 -1
View File
@@ -1610,7 +1610,7 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags,
if(v_stress <= 1)
{
if((v > 1) && (max_stress >= 4) && (stressflags & 4) && (v == (vowel_count-1)))
if((v > 1) && (max_stress >= 2) && (stressflags & 4) && (v == (vowel_count-1)))
{
// option: mark unstressed final syllable as diminished
v_stress = 0;
+9
View File
@@ -94,6 +94,9 @@ static const unsigned short punct_chars[] = {',','.','?','!',':',';',
0x0b1b, // Arabic ;
0x061f, // Arabic ?
0x0f0d, // Tibet Shad
0x0f0e,
0x1362, // Ethiopic period
0x1363,
0x1364,
@@ -137,6 +140,9 @@ static const unsigned int punct_attributes [] = { 0,
CLAUSE_SEMICOLON, // Arabic ;
CLAUSE_QUESTION, // Arabic question mark
CLAUSE_PERIOD+0x8000, // Tibet period
CLAUSE_PARAGRAPH,
CLAUSE_PERIOD, // Ethiopic period
CLAUSE_COMMA, // Ethiopic comma
CLAUSE_SEMICOLON, // Ethiopic semicolon
@@ -2391,6 +2397,9 @@ f_input = f_in; // for GetC etc
continue;
}
if(c1 == 0xf0b)
c1 = ' '; // Tibet inter-syllabic mark, ?? replace by space ??
if(iswspace(c1))
{
char *p_word;
+8
View File
@@ -218,6 +218,8 @@ static int GetMbrName(PHONEME_LIST *plist, PHONEME_TAB *ph, PHONEME_TAB *ph_prev
// bit 2 only at the start of a word
// bit 3 don't match two phonemes across a word boundary
// bit 4 add this phoneme name as a prefix to the next phoneme name (used for de4 phoneme prefix '?')
// bit 5 only in stressed syllable
// bit 6 only at the end of a word
*name2=0;
*split=0;
@@ -257,6 +259,12 @@ static int GetMbrName(PHONEME_LIST *plist, PHONEME_TAB *ph, PHONEME_TAB *ph_prev
if((pr->control & 4) && (plist->newword == 0)) // only at start of word
found = 0;
if((pr->control & 0x40) && (plist[1].newword == 0)) // only at the end of a word
found = 0;
if((pr->control & 0x20) && (plist->stresslevel < plist->wordstress))
found = 0; // only in stressed syllables
if(found)
{
*name2 = pr->mbr_name2;
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.45.47 24.Oct.11";
const char *version_string = "1.45.48 16.Nov.11";
const int version_phdata = 0x014500;
int option_device_number = -1;
+7 -2
View File
@@ -60,6 +60,7 @@
#define OFFSET_KANNADA 0xc80
#define OFFSET_MALAYALAM 0xd00
#define OFFSET_SINHALA 0x0d80
#define OFFSET_TIBET 0x0f00
#define OFFSET_GEORGIAN 0x1080
#define OFFSET_KOREAN 0x1100
@@ -422,6 +423,11 @@ Translator *SelectTranslator(const char *name)
}
break;
case L('b','o'): // Tibet
SetLetterBitsRange(tr,LETTERGP_A,0x71,0x7d); // vowel signs
tr->letter_bits_offset = OFFSET_TIBET;
break;
case L('c','y'): // Welsh
{
static const short stress_lengths_cy[8] = {170,220, 180,180, 0, 0, 250,270};
@@ -578,8 +584,7 @@ Translator *SelectTranslator(const char *name)
case L('c','a'): // Catalan
case L_pap: // Papiamento
{
static const short stress_lengths_es[8] = {180, 210, 190, 190, 0, 0, 230, 260};
// static const short stress_lengths_es[8] = {170, 200, 180, 180, 0, 0, 220, 250};
static const short stress_lengths_es[8] = {180, 190, 230, 190, 0, 0, 230, 260};
static const unsigned char stress_amps_es[8] = {16,12, 18,18, 20,20, 20,20 }; // 'diminished' is used to mark a quieter, final unstressed syllable
static const wchar_t ca_punct_within_word[] = {'\'',0xb7,0}; // ca: allow middle-dot within word
+4 -1
View File
@@ -1436,9 +1436,11 @@ if(dictionary_flags2[0] & FLAG_ABBREV)
dictionary_flags[0] &= ~FLAG_PAUSE1;
}
#ifdef deleted
// but it causes problems if these are not a person name
if(tr->translator_name == L('h','u'))
{
// lang=Hungarian, If the last two words of a clause have capital letters (eg. a person name), unstress the last word.
// lang=hu, If the last two words of a clause have capital letters (eg. a person name), unstress the last word.
if((wflags & (FLAG_LAST_WORD | FLAG_FIRST_UPPER | FLAG_ALL_UPPER | FLAG_FIRST_WORD)) == (FLAG_LAST_WORD | FLAG_FIRST_UPPER))
{
if(((wtab[-1].flags & (FLAG_FIRST_UPPER | FLAG_ALL_UPPER)) == FLAG_FIRST_UPPER) && ((tr->clause_terminator != 0x90028) || (wflags & FLAG_HAS_DOT)))
@@ -1447,6 +1449,7 @@ if(dictionary_flags2[0] & FLAG_ABBREV)
}
}
}
#endif
if((wflags & FLAG_HYPHEN) && (tr->langopts.stress_flags & S_HYPEN_UNSTRESS))
{