42#include "EST_lattice.h"
45#include "EST_StringTrie.h"
63 cerr <<
"lattice save: can't open lattice output file \""
64 << filename <<
"\"" <<
endl;
77 *
outf <<
"# " <<
"Generated by Edinburgh Speech Tools" <<
endl <<
"#" <<
endl;
115 *
outf <<
"J=" <<
acount++ <<
" S=" << from <<
" E=" << to
116 <<
" W=!NULL" <<
endl;
119 *
outf <<
"J=" <<
acount++ <<
" S=" << from <<
" E=" << to
120 <<
" l=" <<
lattice.qmap_index_to_value(symbol->qmap_index)
121 <<
" W=" <<
lattice.nmap_index_to_name(symbol->nmap_index)
155 if (((filename ==
"-") ?
ts.open(
cin) :
ts.open(filename)) != 0)
157 cerr <<
"Can't open lattice input file " << filename <<
endl;
180 str =
ts.get().string();
213 cerr <<
"Error in lattice file : 2 size lines found"
214 <<
" : line " <<
ts.linenum() <<
endl;
227 cerr <<
"Error in lattice file at line "
234 cerr <<
"Error in lattice file at line "
236 <<
" : node index (" <<
nodenum <<
") out of range"
246 cerr <<
"Error in lattice file at line "
253 cerr <<
"Error in lattice file at line "
255 <<
" : arc index (" <<
arcnum <<
") out of range"
262 cerr <<
"Error in lattice file at line " <<
ts.linenum()
264 <<
" arc starts at out of range node "
270 cerr <<
"Error in lattice file at line " <<
ts.linenum()
272 <<
" arc ends at out of range node "
300 cerr <<
"Error in lattice file at line "
301 <<
"found " <<
arcindex <<
" arcs, but expected "
307 cerr <<
"Error in lattice file at line "
308 <<
"found " <<
nodeindex <<
" nodes, but expected "
342 cerr <<
"Built nmap with " << i <<
" entries" <<
endl;
390 cerr <<
"Built qmap with " << i <<
" entries" <<
endl;
422 lattice.alphabet.resize(count);
436 cerr <<
"Alphabet has " << count <<
" symbols " <<
endl;
461 cerr <<
"Couldn't find 'from' node ";
469 cerr <<
"Couldn't find from node, index "
480 cerr <<
"Couldn't find 'to' node ";
488 cerr <<
"Couldn't find to node, index "
500 cerr <<
"Couldn't lookup symbol in alphabet !" <<
endl;
508 if(
to_node->name.head() == NULL)
526 cerr <<
"found " << count <<
" final nodes" <<
endl;
EST_String before(int pos, int len=0) const
Part before position.
int contains(const char *s, int pos=-1) const
Does it contain this substring?
EST_String after(int pos, int len=1) const
Part after pos+len.