50 int main(
int argc,
char *argv[])
61 EST_String(
" [input file1] [input file2] -o [output file]\n") +
62 "Summary: change/copy label files\n"+
63 "use \"-\" to make input and output files stdin/out\n"+
65 "-S <float> frame spacing of output\n"+
66 "-base use base filenames for lists of label files\n"+
67 "-class <string> Name of class defined in op file\n"+
70 "-end <float> end time (secs) for label extraction\n"+
71 "-ext <string> filename extension\n"+
72 "-extend <float> extend track file beyond label file\n"+
73 "-extract <string> extract a single file from a list of label files\n"+
74 "-f <int> sample frequency of label file\n"+
75 "-itype <string> type of input label file: esps htk ogi\n"+
76 "-key <string> key label file\n"+
77 "-lablist <string> list of labels to be considered as blank\n"+
78 "-length <float> length of track produced\n"+
79 "-lf <int> sample frequency for labels\n"+
80 "-map <string> name of file containing label mapping\n"+
81 "-name <string> eg. Fo Phoneme\n"+
82 "-nopath ignore pathnames when searching label lists\n"+
83 "-o <ofile> output gile name\n"+
84 "-off <float> vertical offset of track\n"+
85 "-ops print options\n"+
86 "-otype <string> {esps}\n"+
87 " output file type: xmg, ascii, esps, htk\n"+
88 "-pad <string> Pad with \"high\" or \"low\" values\n"+
89 "-pos <string> list of labels to be regarded as 'pos'\n"+
90 "-q <float> quantize label timings to nearest value\n"+
91 "-range <float> different between high and low values\n"+
92 "-sed <ifile> perform regex editing using sed file\n"+
93 "-shift <float> shift the times of the labels\n"+
94 "-start <float> start time for label extraction\n"+
95 "-style <string> output stype e.g. track\n"+
96 "-vocab <ifile> file containing list of words in vocab\n"+
97 "-verify check that only labels in vocab file are in label file\n",
107 for (p = mlf.
head(); p; p = p->
next())
115 cerr <<
"Couldn't read vocab file " << al.
val(
"-vocab")
116 <<
" for verification\n";
119 for (p = mlf.
head(); p; p = p->
next())
155 if (al.
val(
"-style", 0) ==
"track")
159 tr.
save(out_file, op.
val(
"track_file_type", 0));
163 int path = al.
present(
"-nopath") ? 0 : 1;
164 if (al.
val(
"-otype", 0) ==
"mlf")
166 else if (al.
val(
"-otype", 0) ==
"wmlf")
168 else if (al.
val(
"-otype", 0) ==
"words")
170 else if (al.
val(
"-otype", 0) ==
"sentence")
172 else if (al.
val(
"-otype", 0) ==
"ind")
181 lab.
save(out_file,al.
val(
"-otype"));
194 if (al.
val(
"-style", 0) ==
"track")
int override_val(const EST_String rkey, const EST_String rval)
add to end of list or overwrite. If rval is empty, do nothing
EST_write_status save_ind_RelationList(const EST_String &filename, const EST_RelationList &plist, const EST_String &features, int path)
EST_Relation RelationList_combine(EST_RelationList &mlf)
EST_read_status read_RelationList(EST_RelationList &mlf, EST_StrList &files, EST_Option &al)
EST_write_status save_WordList(const EST_String &filename, const EST_RelationList &plist, int n)
void override_lib_ops(EST_Option &a_list, EST_Option &al)
void label_to_track(const EST_Relation &lab, const EST_Option &al, const EST_Option &op, EST_Track &tr)
void StringtoStrList(EST_String s, EST_StrList &l, EST_String sep)
Convert a EST_String to a EST_StrList by separating tokens in s delimited by the separator sep...
int init_lib_ops(EST_Option &al, EST_Option &options)
EST_Relation RelationList_extract(EST_RelationList &mlf, const EST_String &filename, bool base)
EST_write_status save(const EST_String name, const EST_String EST_filetype="")
void relation_convert(EST_Relation &lab, EST_Option &al, EST_Option &op)
const T & first() const
return const reference to first item in list
EST_write_status save_RelationList(const EST_String &filename, const EST_RelationList &plist)
const V & val(const K &rkey, bool m=0) const
return value according to key (const)
int relation_divide(EST_RelationList &mlf, EST_Relation &lab, EST_Relation &keylab, EST_String ext)
int present(const K &rkey) const
Returns true if key is present.
int main(int argc, char *argv[])
EST_write_status save(const EST_String &filename, bool evaluate_ff=false) const
EST_read_status load(const EST_String &filename, const EST_String &type="esps")
EST_read_status load_StrList(EST_String filename, EST_StrList &l)
Load tokens from a file and return them in a EST_StrList.
int parse_command_line(int argc, char *argv[], const EST_String &usage, EST_StrList &files, EST_Option &al, int make_stdio=1)
int check_vocab(EST_Relation &a, EST_StrList &vocab)
Utility EST_String Functions header file.