41 #include "EST_ling_class.h"
42 #include "EST_Track.h"
43 #include "EST_cmd_line.h"
44 #include "EST_string_aux.h"
77 int main(
int argc,
char *argv[])
88 EST_String(
" [input file1] [input file2] -o [output file]\n") +
89 "Summary: change/copy label files\n"+
90 "use \"-\" to make input and output files stdin/out\n"+
92 "-S <float> frame spacing of output\n"+
93 "-base use base filenames for lists of label files\n"+
94 "-class <string> Name of class defined in op file\n"+
97 "-end <float> end time (secs) for label extraction\n"+
98 "-ext <string> filename extension\n"+
99 "-extend <float> extend track file beyond label file\n"+
100 "-extract <string> extract a single file from a list of label files\n"+
101 "-f <int> sample frequency of label file\n"+
102 "-itype <string> type of input label file: esps htk ogi\n"+
103 "-key <string> key label file\n"+
104 "-lablist <string> list of labels to be considered as blank\n"+
105 "-length <float> length of track produced\n"+
106 "-lf <int> sample frequency for labels\n"+
107 "-map <string> name of file containing label mapping\n"+
108 "-name <string> eg. Fo Phoneme\n"+
109 "-nopath ignore pathnames when searching label lists\n"+
110 "-o <ofile> output gile name\n"+
111 "-off <float> vertical offset of track\n"+
112 "-ops print options\n"+
113 "-otype <string> {esps}\n"+
114 " output file type: xmg, ascii, esps, htk\n"+
115 "-pad <string> Pad with \"high\" or \"low\" values\n"+
116 "-pos <string> list of labels to be regarded as 'pos'\n"+
117 "-q <float> quantize label timings to nearest value\n"+
118 "-range <float> different between high and low values\n"+
119 "-sed <ifile> perform regex editing using sed file\n"+
120 "-shift <float> shift the times of the labels\n"+
121 "-start <float> start time for label extraction\n"+
122 "-style <string> output stype e.g. track\n"+
123 "-vocab <ifile> file containing list of words in vocab\n"+
124 "-verify check that only labels in vocab file are in label file\n",
127 init_lib_ops(al, op);
131 read_RelationList(mlf, files, al);
134 for (p = mlf.head(); p; p = p->next())
135 relation_convert(mlf(p), al, op);
140 if (load_StrList(al.
val(
"-vocab"), vocab) != format_ok)
142 cerr <<
"Couldn't read vocab file " << al.
val(
"-vocab")
143 <<
" for verification\n";
146 for (p = mlf.head(); p; p = p->next())
147 check_vocab(mlf(p), vocab);
151 if (files.length() == 1)
155 lab = RelationList_extract(mlf, al.
val(
"-extract"),
163 lab = RelationList_combine(mlf, key);
166 lab = RelationList_combine(mlf);
175 StringtoStrList(al.
val(
"-lablist"), blank);
176 if (relation_divide(mlf, lab, key, blank, ext) == -1)
182 if (al.
val(
"-style", 0) ==
"track")
185 label_to_track(lab, al, op, tr);
186 tr.
save(out_file, op.
val(
"track_file_type", 0));
190 int path = al.
present(
"-nopath") ? 0 : 1;
191 if (al.
val(
"-otype", 0) ==
"mlf")
192 save_RelationList(out_file, mlf, 1, path);
193 else if (al.
val(
"-otype", 0) ==
"wmlf")
194 save_RelationList(out_file, mlf, 0, path);
195 else if (al.
val(
"-otype", 0) ==
"words")
196 save_WordList(out_file, mlf, 0);
197 else if (al.
val(
"-otype", 0) ==
"sentence")
198 save_WordList(out_file, mlf, 1);
199 else if (al.
val(
"-otype", 0) ==
"ind")
202 save_ind_RelationList(out_file, mlf,
"Addresses", path);
204 save_ind_RelationList(out_file, mlf,
"None", path);
208 lab.
save(out_file,al.
val(
"-otype"));
221 if (al.
val(
"-style", 0) ==
"track")