mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 21:39:47 +00:00
[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:
+10
-3
@@ -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] = ' ';
|
||||
|
||||
Reference in New Issue
Block a user