static const cst_val *seg_onset_ctype(const cst_item *seg, const char *ctype) { const cst_item *s; const cst_phoneset *ps = item_phoneset(seg); for (s=item_daughter(item_parent(item_as(seg,"SylStructure"))); s; s=item_next(s)) { if (cst_streq("+",phone_feature_string(ps,item_feat_string(s,"name"), "vc"))) return VAL_STRING_0; if (cst_streq(ctype,phone_feature_string(ps,item_feat_string(s,"name"), "ctype"))) return VAL_STRING_1; } return VAL_STRING_0; }
static void apostrophe_s(cst_utterance *u) { cst_item *s; cst_item *schwa; const cst_phoneset *ps = u->vox->phoneset; const char *pname, *word; for (s=item_next(UTT_REL_HEAD(u,SEGMENT)); s; s=item_next(s)) { word = val_string(ffeature(s, "R:"SYLSTRUCTURE".P.P.name")); if (cst_streq("'s", word)) { pname = item_feat_string(item_prev(s),"name"); if ((strchr("fa",*phone_feature_string(ps,pname,"ctype")) != NULL) && (strchr("dbg", *phone_feature_string(ps,pname,"cplace")) == NULL)) /* needs a schwa */ { schwa = item_prepend(s,NULL); item_set_string(schwa,"name","ax"); item_prepend(item_as(s,SYLSTRUCTURE),schwa); } else if (cst_streq("-",phone_feature_string(ps,pname,"cvox"))) item_set_string(s,"name","s"); } else if (cst_streq("'ve", word) || cst_streq("'ll", word) || cst_streq("'d", word)) { if (cst_streq("-",ffeature_string(s,"p."PH_VC))) { schwa = item_prepend(s,NULL); item_set_string(schwa,"name","ax"); item_prepend(item_as(s,SYLSTRUCTURE),schwa); } } } }
static const cst_val *seg_onsetcoda(const cst_item *seg) { const cst_item *s; const cst_phoneset *ps = item_phoneset(seg); for (s=item_next(item_as(seg,"SylStructure")); s; s=item_next(s)) { if (cst_streq("+",phone_feature_string(ps,item_feat_string(s,"name"), "vc"))) return (cst_val *)&val_string_onset; } return (cst_val *)&val_string_coda; }