Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 43 of file fstisstochastic.cc.
References ParseOptions::GetOptArg(), fst::IsStochasticFst(), fst::IsStochasticFstInLog(), ParseOptions::NumArgs(), ParseOptions::PrintUsage(), ParseOptions::Read(), fst::ReadFstKaldiGeneric(), and ParseOptions::Register().
45 using namespace kaldi;
50 "Checks whether an FST is stochastic and exits with success if so.\n" 51 "Prints out maximum error (in log units).\n" 53 "Usage: fstisstochastic [ in.fst ]\n";
56 bool test_in_log =
true;
59 po.Register(
"delta", &delta,
"Maximum error to accept.");
60 po.Register(
"test-in-log", &test_in_log,
"Test stochasticity in log semiring.");
63 if (po.NumArgs() > 1) {
68 std::string fst_in_filename = po.GetOptArg(1);
77 std::cout << min.Value() <<
" " << max.Value() <<
'\n';
81 }
catch(
const std::exception &e) {
82 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Fst< StdArc > * ReadFstKaldiGeneric(std::string rxfilename, bool throw_on_err)
For an extended explanation of the framework of which grammar-fsts are a part, please see Support for...
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
bool IsStochasticFstInLog(const Fst< StdArc > &fst, float delta, StdArc::Weight *min_sum, StdArc::Weight *max_sum)
bool IsStochasticFst(const Fst< LogArc > &fst, float delta, LogArc::Weight *min_sum, LogArc::Weight *max_sum)
fst::StdArc::Weight Weight