104
104
u->create_relation("Phrase");
106
for (w=u->relation("Word")->first(); w != 0; w = next(w))
106
for (w=u->relation("Word")->first(); w != 0; w = w->next())
109
109
phr = add_phrase(u);
110
110
append_daughter(phr,"Phrase",w);
113
113
w->set("pbreak","B");
114
114
phr->set_name("4");
127
127
u->create_relation("Phrase");
128
128
tree = siod_get_lval("phrase_cart_tree","no phrase cart tree");
130
for (w=u->relation("Word")->first(); w != 0; w = next(w))
130
for (w=u->relation("Word")->first(); w != 0; w = w->next())
133
133
phr = add_phrase(u);
209
209
pbyp_get_params(siod_get_lval("phr_break_params",NULL));
210
210
gc_protect(&bb_tags);
212
for (w=u->relation("Word")->first(); w != 0; w = next(w))
212
for (w=u->relation("Word")->first(); w != 0; w = w->next())
213
213
{ // Set up tag index for pos ngram
214
214
EST_String lpos = map_pos(pos_map,w->f("pos").string());
215
215
w->set("phr_pos",lpos);
229
229
// Given predicted break, go through and add phrases
230
230
u->create_relation("Phrase");
231
for (w=u->relation("Word")->first(); w != 0; w = next(w))
231
for (w=u->relation("Word")->first(); w != 0; w = w->next())
233
233
w->set("pbreak",bb_ngram->
234
234
get_vocab_word(w->f("pbreak_index").Int()));
266
266
if (bb_pos_ngram->order() == 4)
268
268
window[1] = s->I("pos_index",0);
270
window[0] = prev(s)->I("pos_index",0);
270
window[0] = s->prev()->I("pos_index",0);
272
272
window[0] = pos_p_start_tag;
274
window[2] = next(s)->I("pos_index",0);
274
window[2] = s->next()->I("pos_index",0);
276
276
window[2] = pos_n_start_tag;
278
278
else if (bb_pos_ngram->order() == 3)
280
280
window[0] = s->I("pos_index",0);
282
window[1] = next(s)->I("pos_index",0);
282
window[1] = s->next()->I("pos_index",0);
284
284
window[1] = pos_n_start_tag;
286
286
else if (bb_pos_ngram->order() == 5)
287
287
{ // This is specific for some set of pos tagsets
288
288
window[2] = s->I("pos_index",0);
291
window[1] = prev(s)->I("pos_index",0);
291
window[1] = s->prev()->I("pos_index",0);
295
295
window[1] = pos_p_start_tag;
299
window[3] = next(s)->I("pos_index",0);
300
if (next(next(s)) != 0)
301
window[0] = next(next(s))->I("pos_index",0);
299
window[3] = s->next()->I("pos_index",0);
300
if (s->next()->next() != 0)
301
window[0] = s->next()->next()->I("pos_index",0);
329
329
all_c = c; // but then if you give only one option ...
331
else if (next(s) == 0) // end of utterances so force a break
331
else if (s->next() == 0) // end of utterances so force a break
333
333
EST_VTCandidate *c = new EST_VTCandidate;
634
634
pbyp_get_params(siod_get_lval("phr_break_params",NULL));
635
635
gc_protect(&bb_tags);
637
for (w=u->relation("Word")->first(); w != 0; w = next(w))
637
for (w=u->relation("Word")->first(); w != 0; w = w->next())
638
638
{ // Set up tag index for pos ngram
639
639
EST_String lpos = map_pos(pos_map,w->f("pos").string());
640
640
w->set("phr_pos",lpos);
652
652
// Given predicted break, go through and add phrases
653
653
u->create_relation("Phrase");
654
for (w=u->relation("Word")->first(); w != 0; w = next(w))
654
for (w=u->relation("Word")->first(); w != 0; w = w->next())
656
656
w->set("pbreak",bb_ngram->
657
657
get_vocab_word(w->f("pbreak_index").Int()));