Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 45 of file fstrmepslocal.cc.
References ParseOptions::GetOptArg(), ParseOptions::NumArgs(), ParseOptions::PrintUsage(), ParseOptions::Read(), fst::ReadFstKaldi(), ParseOptions::Register(), fst::RemoveEpsLocal(), fst::RemoveEpsLocalSpecial(), and fst::WriteFstKaldi().
47 using namespace kaldi;
52 "Removes some (but not all) epsilons in an algorithm that will always reduce the number of\n" 53 "arcs+states. Option to preserves equivalence in tropical or log semiring, and\n" 54 "if in tropical, stochasticit in either log or tropical.\n" 56 "Usage: fstrmepslocal [in.fst [out.fst] ]\n";
60 bool stochastic_in_log =
true;
61 po.Register(
"use-log", &use_log,
62 "Preserve equivalence in log semiring [false->tropical]\n");
63 po.Register(
"stochastic-in-log", &stochastic_in_log,
64 "Preserve stochasticity in log semiring [false->tropical]\n");
67 if (po.NumArgs() > 2) {
72 std::string fst_in_filename = po.GetOptArg(1),
73 fst_out_filename = po.GetOptArg(2);
77 if (!use_log && stochastic_in_log) {
79 }
else if (use_log && !stochastic_in_log) {
80 std::cerr <<
"fstrmsymbols: invalid combination of flags\n";
83 VectorFst<LogArc> log_fst;
87 fst =
new VectorFst<StdArc>;
96 }
catch(
const std::exception &e) {
97 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void RemoveEpsLocal(MutableFst< Arc > *fst)
RemoveEpsLocal remove some (but not necessarily all) epsilons in an FST, using an algorithm that is g...
For an extended explanation of the framework of which grammar-fsts are a part, please see Support for...
void RemoveEpsLocalSpecial(MutableFst< StdArc > *fst)
As RemoveEpsLocal but takes care to preserve stochasticity when cast to LogArc.
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
void WriteFstKaldi(std::ostream &os, bool binary, const VectorFst< Arc > &t)
void ReadFstKaldi(std::istream &is, bool binary, VectorFst< Arc > *fst)