41 #ifndef __EST_LATTICE_H__
42 #define __EST_LATTICE_H__
44 #include "EST_types.h"
45 #include "EST_Track.h"
70 bool operator != (
const symbol_t &s2)
const;
95 friend inline ostream& operator<<(ostream& s,
const Lattice::Node &n);
96 friend inline ostream& operator<<(ostream& s,
const Lattice::Arc &n);
100 float qmap_error_margin;
113 int e_move_symbol_index;
120 int alphabet_index_lookup(
int nmap_index,
int qmap_index);
136 bool build_transition_function();
138 bool build_distinguished_state_table(
bool ** &dst);
139 bool build_distinguished_state_table_direct(
bool ** &dst);
140 bool build_distinguished_state_table_from_transition_function(
bool ** &dst);
142 void sort_arc_lists();
143 bool link(
Node *n1,
Node *n2,
int label);
147 void prune_arc(
Node *node,
Arc *arc);
149 void remove_arc_from_nodes_out_list(
Node *n,
Arc *a);
151 int node_index(
Node *n);
176 Node *start_node = NULL);
179 float viterbi_transduce(
EST_Track &observations,
182 int current_frame = 0,
183 Node *start_node = NULL);
187 float qmap_index_to_value(
int index);
188 int qmap_value_to_index(
float value);
191 int nmap_name_to_index(
const EST_String &name);
193 symbol_t* alphabet_index_to_symbol(
int index);
194 int alphabet_symbol_to_index(
symbol_t *sym);
200 friend class Lattice_Language_Model;
224 if(s1.qmap_index > s2.qmap_index)
227 if(s1.qmap_index < s2.qmap_index)
230 return (s1.nmap_index > s2.nmap_index);
237 if(s1.qmap_index < s2.qmap_index)
240 if(s1.qmap_index > s2.qmap_index)
243 return (s1.nmap_index < s2.nmap_index);
252 cerr <<
"operator + makes no sense for Lattice::symbol_t !" << endl;
260 return (a1.label > a2.label);
265 return (a1.label < a2.label);
270 return (a1.label >= a2.label);
275 return (a1.label <= a2.label);
280 return (a1.label == a2.label);
285 return ((s1.nmap_index == s2.nmap_index) &&
286 (s1.qmap_index == s2.qmap_index) );
307 s <<
"[q=" << sm.qmap_index <<
",n=" << sm.nmap_index <<
"]";
312 inline ostream& operator<<(ostream& s,
const Lattice::Node &n)
314 s <<
"Node:" << n.name;
318 inline ostream& operator<<(ostream &s,
const Lattice::Arc &a)