mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-24 20:31:15 +00:00
Ensure phoneme type is set before start/endtype.
The eSpeak code uses `end_type` for the `voicingswitch` property when used with consonants. It also allows `endtype` to be specified in consonants if it is the same as `starttype`. This code adds a check in the `starttype` and `endtype` handlers to ensure that the phoneme type has been set to preserve the eSpeak behaviour for these properties.
This commit is contained in:
@@ -2142,12 +2142,16 @@ int CompilePhoneme(int compile_phoneme)
|
|||||||
if (phcode == -1)
|
if (phcode == -1)
|
||||||
phcode = LookupPhoneme(item_string, 1);
|
phcode = LookupPhoneme(item_string, 1);
|
||||||
phoneme_out->start_type = phcode;
|
phoneme_out->start_type = phcode;
|
||||||
|
if (phoneme_out->type == phINVALID)
|
||||||
|
error("a phoneme type or manner of articulation must be specified before starttype");
|
||||||
break;
|
break;
|
||||||
case kENDTYPE:
|
case kENDTYPE:
|
||||||
phcode = NextItem(tPHONEMEMNEM);
|
phcode = NextItem(tPHONEMEMNEM);
|
||||||
if (phcode == -1)
|
if (phcode == -1)
|
||||||
phcode = LookupPhoneme(item_string, 1);
|
phcode = LookupPhoneme(item_string, 1);
|
||||||
if (phoneme_out->type == phVOWEL)
|
if (phoneme_out->type == phINVALID)
|
||||||
|
error("a phoneme type or manner of articulation must be specified before endtype");
|
||||||
|
else if (phoneme_out->type == phVOWEL)
|
||||||
phoneme_out->end_type = phcode;
|
phoneme_out->end_type = phcode;
|
||||||
else if (phcode != phoneme_out->start_type)
|
else if (phcode != phoneme_out->start_type)
|
||||||
error("endtype must equal starttype for consonants");
|
error("endtype must equal starttype for consonants");
|
||||||
|
|||||||
Reference in New Issue
Block a user