30 int main(
int argc,
char *argv[]) {
36 "Generate random FST\n" 38 "Usage: fstrand [out.fst]\n";
46 "If true, we may generate an empty FST.");
55 std::string fst_out_filename = po.
GetOptArg(1);
57 VectorFst <StdArc> *rand_fst = RandFst<StdArc>(opts);
62 }
catch(
const std::exception &e) {
63 std::cerr << e.what();
For an extended explanation of the framework of which grammar-fsts are a part, please see Support for...
void PrintUsage(bool print_command_line=false)
Prints the usage documentation [provided in the constructor].
void Register(const std::string &name, bool *ptr, const std::string &doc)
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
int Read(int argc, const char *const *argv)
Parses the command line options and fills the ParseOptions-registered variables.
int main(int argc, char *argv[])
int NumArgs() const
Number of positional parameters (c.f. argc-1).
void WriteFstKaldi(std::ostream &os, bool binary, const VectorFst< Arc > &t)
std::string GetOptArg(int param) const