[1.47.16]

Added rule attribute $noprefix for *_rules files.  The rule is not used if a prefix has been removed from the word.

Language changes: en, or, pt, ta.


git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@369 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2014-01-21 16:30:18 +00:00
parent 3d49b74315
commit 5048e535ba
25 changed files with 1054 additions and 157 deletions
+2 -1
View File
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2005 to 2013 by Jonathan Duddington *
* Copyright (C) 2005 to 2014 by Jonathan Duddington *
* email: jonsd@users.sourceforge.net *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -51,6 +51,7 @@ static char letterGroupsDefined[N_LETTER_GROUPS];
MNEM_TAB mnem_rules[] = {
{"unpr", 0x01},
{"noprefix", 0x02}, // rule fails if a prefix has been removed
{"w_alt1", 0x11},
{"w_alt2", 0x12},
+10 -3
View File
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2005 to 2013 by Jonathan Duddington *
* Copyright (C) 2005 to 2014 by Jonathan Duddington *
* email: jonsd@users.sourceforge.net *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -2165,6 +2165,13 @@ static void MatchRule(Translator *tr, char *word[], char *word_start, int group_
{
match.end_type = SUFX_UNPRON; // $unpron
}
else if(command == 0x02) // $noprefix
{
if(word_flags & FLAG_PREFIX_REMOVED)
failed = 1; // a prefix has been removed
else
add_points = 1;
}
else if((command & 0xf0) == 0x10)
{
// $w_alt
@@ -3604,7 +3611,7 @@ int RemoveEnding(Translator *tr, char *word, int end_type, char *word_copy)
int end_flags;
const char *p;
int len;
static char ending[12];
char ending[50];
// these lists are language specific, but are only relevent if the 'e' suffix flag is used
static const char *add_e_exceptions[] = {
@@ -3642,7 +3649,7 @@ int RemoveEnding(Translator *tr, char *word, int end_type, char *word_copy)
}
// remove bytes from the end of the word and replace them by spaces
for(i=0; i<len_ending; i++)
for(i=0; (i<len_ending) && (i < sizeof(ending)-1); i++)
{
ending[i] = word_end[i];
word_end[i] = ' ';
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.47.15 22.Dec.13";
const char *version_string = "1.47.16 21.Jan.14";
const int version_phdata = 0x014709;
int option_device_number = -1;
+3 -2
View File
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2005 to 2013 by Jonathan Duddington *
* Copyright (C) 2005 to 2014 by Jonathan Duddington *
* email: jonsd@users.sourceforge.net *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -1269,6 +1269,7 @@ if(end_type & SUFX_UNPRON)
c_temp = wordx[-1];
wordx[-1] = ' ';
confirm_prefix = 1;
wflags |= FLAG_PREFIX_REMOVED;
if(prefix_type & SUFX_B)
{
@@ -1310,7 +1311,7 @@ if(end_type & SUFX_UNPRON)
prefix_flags = 1;
if(found == 0)
{
end_type = TranslateRules(tr, wordx, phonemes, N_WORD_PHONEMES, end_phonemes, wflags & FLAG_HYPHEN_AFTER, dictionary_flags);
end_type = TranslateRules(tr, wordx, phonemes, N_WORD_PHONEMES, end_phonemes, wflags & (FLAG_HYPHEN_AFTER | FLAG_PREFIX_REMOVED), dictionary_flags);
if(phonemes[0] == phonSWITCH)
{
+2 -1
View File
@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (C) 2005 to 2013 by Jonathan Duddington *
* Copyright (C) 2005 to 2014 by Jonathan Duddington *
* email: jonsd@users.sourceforge.net *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -117,6 +117,7 @@
#define FLAG_DELETE_WORD 0x100000 // don't speak this word, it has been spoken as part of the previous word
#define FLAG_CHAR_REPLACED 0x200000 // characters have been replaced by .replace in the *_rules
#define FLAG_TRANSLATOR2 0x400000 // retranslating using a different language
#define FLAG_PREFIX_REMOVED 0x800000 // a prefix has been removed from this word
#define FLAG_SUFFIX_VOWEL 0x08000000 // remember an initial vowel from the suffix
#define FLAG_NO_TRACE 0x10000000 // passed to TranslateRules() to suppress dictionary lookup printout