Browse Source

phoneme_add_feature: support setting the voice features.

The 'fortis' feature is not used, so it has been removed.
master
Reece H. Dunn 8 years ago
parent
commit
9dc3d27497
2 changed files with 10 additions and 5 deletions
  1. 0
    5
      src/libespeak-ng/compiledata.c
  2. 10
    0
      src/libespeak-ng/phoneme.c

+ 0
- 5
src/libespeak-ng/compiledata.c View File

// flags // flags
{ "wavef", tPHONEME_FLAG, phWAVE }, { "wavef", tPHONEME_FLAG, phWAVE },
{ "unstressed", tPHONEME_FLAG, phUNSTRESSED }, { "unstressed", tPHONEME_FLAG, phUNSTRESSED },
{ "fortis", tPHONEME_FLAG, phFORTIS },
{ "sibilant", tPHONEME_FLAG, phSIBILANT }, // TODO (deprecated): use 'sib' instead { "sibilant", tPHONEME_FLAG, phSIBILANT }, // TODO (deprecated): use 'sib' instead
{ "nolink", tPHONEME_FLAG, phNOLINK }, { "nolink", tPHONEME_FLAG, phNOLINK },
{ "trill", tPHONEME_FLAG, phTRILL }, // TODO (deprecated): use 'trl' instead { "trill", tPHONEME_FLAG, phTRILL }, // TODO (deprecated): use 'trl' instead
{ "flag2", tPHONEME_FLAG, phFLAG2 }, { "flag2", tPHONEME_FLAG, phFLAG2 },
{ "flag3", tPHONEME_FLAG, phFLAG3 }, { "flag3", tPHONEME_FLAG, phFLAG3 },


// voiced / unvoiced
{ "vcd", tPHONEME_FLAG, phVOICED },
{ "vls", tPHONEME_FLAG, phFORTIS },

// vowel transition attributes // vowel transition attributes
{ "len=", tTRANSITION, 1 }, { "len=", tTRANSITION, 1 },
{ "rms=", tTRANSITION, 2 }, { "rms=", tTRANSITION, 2 },

+ 10
- 0
src/libespeak-ng/phoneme.c View File

uvl = FEATURE('u', 'v', 'l'), uvl = FEATURE('u', 'v', 'l'),
phr = FEATURE('p', 'h', 'r'), phr = FEATURE('p', 'h', 'r'),
glt = FEATURE('g', 'l', 't'), glt = FEATURE('g', 'l', 't'),
// voice
vcd = FEATURE('v', 'c', 'd'),
vls = FEATURE('v', 'l', 's'),
}; };


uint32_t lookup_feature(const char *feature) { uint32_t lookup_feature(const char *feature) {
case alp: case alp:
// FIXME: Not supported by eSpeak. Used in Chinese/Japanese ɕ and ʑ. // FIXME: Not supported by eSpeak. Used in Chinese/Japanese ɕ and ʑ.
break; break;
// voice
case vcd:
phoneme->phflags |= phVOICED;
break;
case vls: // FIXME: This should be a phVOICELESS (!phVOICED) flag. Fortis/lenis are a different thing.
phoneme->phflags |= phFORTIS;
break;
// invalid phoneme feature // invalid phoneme feature
default: default:
return create_name_error_context(context, ENS_UNKNOWN_PHONEME_FEATURE, feature); return create_name_error_context(context, ENS_UNKNOWN_PHONEME_FEATURE, feature);

Loading…
Cancel
Save