Lines 47-52
Link Here
|
47 |
#include "festival.h" |
47 |
#include "festival.h" |
48 |
#include "intonation.h" |
48 |
#include "intonation.h" |
49 |
|
49 |
|
|
|
50 |
using std::cerr; |
51 |
using std::endl; |
52 |
|
50 |
enum lr_tpos {tp_start, tp_mid, tp_end}; |
53 |
enum lr_tpos {tp_start, tp_mid, tp_end}; |
51 |
|
54 |
|
52 |
static EST_String accent_specified(EST_Item *s); |
55 |
static EST_String accent_specified(EST_Item *s); |
Lines 87-97
LISP FT_Intonation_Tree_Utt(LISP utt)
Link Here
|
87 |
for (s=u->relation("Syllable")->first(); s != 0; s=next(s)) |
90 |
for (s=u->relation("Syllable")->first(); s != 0; s=next(s)) |
88 |
{ |
91 |
{ |
89 |
if ((paccent = accent_specified(s)) == "0") // check if pre-specified |
92 |
if ((paccent = accent_specified(s)) == "0") // check if pre-specified |
90 |
paccent = (EST_String)wagon_predict(s,accent_tree); |
93 |
paccent = EST_String(wagon_predict(s,accent_tree)); |
91 |
if (paccent != "NONE") |
94 |
if (paccent != "NONE") |
92 |
add_IntEvent(u,s,paccent); |
95 |
add_IntEvent(u,s,paccent); |
93 |
if ((ptone = tone_specified(s)) == "0") |
96 |
if ((ptone = tone_specified(s)) == "0") |
94 |
ptone = (EST_String)wagon_predict(s,endtone_tree); |
97 |
ptone = EST_String(wagon_predict(s,endtone_tree)); |
95 |
if (ptone != "NONE") |
98 |
if (ptone != "NONE") |
96 |
add_IntEvent(u,s,ptone); |
99 |
add_IntEvent(u,s,ptone); |
97 |
} |
100 |
} |
Lines 107-117
static EST_String accent_specified(EST_I
Link Here
|
107 |
EST_Item *token = parent(word,"Token"); |
110 |
EST_Item *token = parent(word,"Token"); |
108 |
EST_String paccent("0"); |
111 |
EST_String paccent("0"); |
109 |
if (token) |
112 |
if (token) |
110 |
paccent = (EST_String)ffeature(token,"accent"); |
113 |
paccent = EST_String(ffeature(token,"accent")); |
111 |
|
114 |
|
112 |
if (paccent == "0") |
115 |
if (paccent == "0") |
113 |
{ |
116 |
{ |
114 |
paccent = (EST_String)ffeature(word,"accent"); |
117 |
paccent = EST_String(ffeature(word,"accent")); |
115 |
if (paccent == "0") |
118 |
if (paccent == "0") |
116 |
return paccent; |
119 |
return paccent; |
117 |
} |
120 |
} |
Lines 139-149
static EST_String tone_specified(EST_Ite
Link Here
|
139 |
EST_Item *token = parent(word,"Token"); |
142 |
EST_Item *token = parent(word,"Token"); |
140 |
EST_String ptone("0"); |
143 |
EST_String ptone("0"); |
141 |
if (token) |
144 |
if (token) |
142 |
ptone = (EST_String)ffeature(token,"tone"); |
145 |
ptone = EST_String(ffeature(token,"tone")); |
143 |
|
146 |
|
144 |
if (ptone == "0") |
147 |
if (ptone == "0") |
145 |
{ |
148 |
{ |
146 |
ptone = (EST_String)ffeature(word,"tone"); |
149 |
ptone = EST_String(ffeature(word,"tone")); |
147 |
if (ptone == "0") |
150 |
if (ptone == "0") |
148 |
return ptone; |
151 |
return ptone; |
149 |
} |
152 |
} |
Lines 272-278
static void add_target_at(EST_Utterance
Link Here
|
272 |
add_target(u,seg,seg->F("end"),val); |
275 |
add_target(u,seg,seg->F("end"),val); |
273 |
else |
276 |
else |
274 |
{ |
277 |
{ |
275 |
cerr << "add_target_at: unknown position type\n"; |
278 |
cerr << "add_target_at: unknown position type" << endl; |
276 |
festival_error(); |
279 |
festival_error(); |
277 |
} |
280 |
} |
278 |
} |
281 |
} |