|
|
#include "festival.h" | #include "festival.h" |
#include "intonation.h" | #include "intonation.h" |
| |
|
using std::cerr; |
|
using std::endl; |
|
|
enum lr_tpos {tp_start, tp_mid, tp_end}; | enum lr_tpos {tp_start, tp_mid, tp_end}; |
| |
static EST_String accent_specified(EST_Item *s); | static EST_String accent_specified(EST_Item *s); |
|
Lines 87-97
LISP FT_Intonation_Tree_Utt(LISP utt)
|
Link Here
|
|---|
|
for (s=u->relation("Syllable")->first(); s != 0; s=next(s)) | for (s=u->relation("Syllable")->first(); s != 0; s=next(s)) |
{ | { |
if ((paccent = accent_specified(s)) == "0") // check if pre-specified | if ((paccent = accent_specified(s)) == "0") // check if pre-specified |
paccent = (EST_String)wagon_predict(s,accent_tree); |
paccent = EST_String(wagon_predict(s,accent_tree)); |
if (paccent != "NONE") | if (paccent != "NONE") |
add_IntEvent(u,s,paccent); | add_IntEvent(u,s,paccent); |
if ((ptone = tone_specified(s)) == "0") | if ((ptone = tone_specified(s)) == "0") |
ptone = (EST_String)wagon_predict(s,endtone_tree); |
ptone = EST_String(wagon_predict(s,endtone_tree)); |
if (ptone != "NONE") | if (ptone != "NONE") |
add_IntEvent(u,s,ptone); | add_IntEvent(u,s,ptone); |
} | } |
|
Lines 107-117
static EST_String accent_specified(EST_I
|
Link Here
|
|---|
|
EST_Item *token = parent(word,"Token"); | EST_Item *token = parent(word,"Token"); |
EST_String paccent("0"); | EST_String paccent("0"); |
if (token) | if (token) |
paccent = (EST_String)ffeature(token,"accent"); |
paccent = EST_String(ffeature(token,"accent")); |
| |
if (paccent == "0") | if (paccent == "0") |
{ | { |
paccent = (EST_String)ffeature(word,"accent"); |
paccent = EST_String(ffeature(word,"accent")); |
if (paccent == "0") | if (paccent == "0") |
return paccent; | return paccent; |
} | } |
|
Lines 139-149
static EST_String tone_specified(EST_Ite
|
Link Here
|
|---|
|
EST_Item *token = parent(word,"Token"); | EST_Item *token = parent(word,"Token"); |
EST_String ptone("0"); | EST_String ptone("0"); |
if (token) | if (token) |
ptone = (EST_String)ffeature(token,"tone"); |
ptone = EST_String(ffeature(token,"tone")); |
| |
if (ptone == "0") | if (ptone == "0") |
{ | { |
ptone = (EST_String)ffeature(word,"tone"); |
ptone = EST_String(ffeature(word,"tone")); |
if (ptone == "0") | if (ptone == "0") |
return ptone; | return ptone; |
} | } |
|
Lines 272-278
static void add_target_at(EST_Utterance
|
Link Here
|
|---|
|
add_target(u,seg,seg->F("end"),val); | add_target(u,seg,seg->F("end"),val); |
else | else |
{ | { |
cerr << "add_target_at: unknown position type\n"; |
cerr << "add_target_at: unknown position type" << endl; |
festival_error(); | festival_error(); |
} | } |
} | } |