45#include "EST_simplestats.h"
51static int wfst_train_main(
int argc,
char **
argv);
93static int wfst_train_main(
int argc,
char **
argv)
103 EST_String(
"[WFSTFILE] [input file0] ... [-o output file]\n")+
104 "Summary: Train a WFST on data\n"+
105 "-wfst <ifile> The WFST to start from\n"+
106 "-data <ifile> Sentences in the language recognised by WFST\n"+
107 "-o <ofile> Output file for trained WFST\n"+
108 "-heap <int> {210000}\n"+
109 " Set size of Lisp heap, needed for large rulesets\n",
112 if (
al.present(
"-o"))
115 EST_error(
"can't open output file for writing \"%s\"",
116 (
const char *)
al.val(
"-o"));
121 if (
al.present(
"-wfst"))
124 EST_error(
"no WFST specified");
126 siod_init(
al.ival(
"-heap"));
133 EST_error(
"failed to read WFST from \"%s\"",
136 data = load_string_data(wfst,
al.val(
"-data"));
138 wfst_train(wfst,data);
140 if (wfst.
save(
al.val(
"-o")) != write_ok)
141 EST_error(
"failed to write trained WFST to \"%s\"",
142 (
const char *)
al.val(
"-o"));
EST_write_status save(const EST_String &filename, const EST_String type="ascii")
?
EST_read_status load(const EST_String &filename)
?