46#include "EST_cutils.h"
47#include "EST_Features.h"
48#include "ling_class/EST_Relation.h"
58class EST_VTCandidate {
61 EST_VTCandidate() {score=0.0; next=0; s=0; }
62 ~EST_VTCandidate() {
if (next != 0)
delete next;}
67 EST_VTCandidate *next;
79 EST_VTPath() {score=0.0; from=0; next=0; c=0;}
80 ~EST_VTPath() {
if (next != 0)
delete next;}
97 EST_VTPoint() {next=0; s=0; paths=0; num_paths=0; cands=0; st_paths=0; num_states=0;}
102 EST_VTCandidate *cands;
104 EST_VTPath **st_paths;
130class EST_Viterbi_Decoder {
143 uclist_f_t user_clist;
144 unpath_f_t user_npath;
145 EST_VTPoint *timeline;
149 float overall_path_pruning_envelope_width;
150 float candidate_pruning_envelope_width;
152 void add_path(EST_VTPoint *p, EST_VTPath *np);
153 void vit_add_path(EST_VTPoint *p, EST_VTPath *np);
154 void vit_add_paths(EST_VTPoint *p, EST_VTPath *np);
155 EST_VTPath *find_best_end()
const;
156 const int betterthan(
const float a,
const float b)
const;
157 void prune_initialize(EST_VTPoint *p,
158 double &best_score,
double &best_candidate_score,
159 double &score_cutoff,
double &candidate_cutoff,
169 const double vit_a_big_number;
174 EST_Viterbi_Decoder(uclist_f_t a, unpath_f_t b);
178 EST_Viterbi_Decoder(uclist_f_t a, unpath_f_t b,
int num_states);
180 ~EST_Viterbi_Decoder();
182 void set_beam_width(
int w) {beam_width = w;}
184 void set_cand_width(
int w) {cand_width = w;}
186 void set_debug(
int d) {debug = d;}
192 void set_big_is_good(
int flag) { big_is_good = flag; }
196 EST_VTCandidate *add_cand_prune(EST_VTCandidate *newcand,
197 EST_VTCandidate *allcands);
199 bool vit_prune_path(
double path_score,
double score_cutoff);
202 void initialise(EST_Relation *r);
205 void set_pruning_parameters(
float beam,
float ob_beam);
207 void turn_on_debug();
208 void turn_on_trace();
216 bool result(
const EST_String &n);
221 bool result( EST_VTPath **bestPathEnd );
224 void copy_feature(
const EST_String &n);