25 #include "fst/fstlib.h" 37 int main(
int argc,
char *argv[]) {
39 using namespace kaldi;
44 "Minimizes FST after encoding [this algorithm applicable to all FSTs in tropical semiring]\n" 46 "Usage: fstaddsubsequentialloop subseq_sym [in.fst [out.fst] ]\n" 47 "E.g.: fstaddsubsequentialloop 52 < LG.fst > LG_sub.fst\n";
52 "Delta likelihood used for quantization of weights");
64 std::string fst_in_filename = po.
GetOptArg(2);
66 std::string fst_out_filename = po.
GetOptArg(3);
71 if (subseq_sym <= h) {
72 std::cerr <<
"fstaddsubsequentialloop.cc: subseq symbol does not seem right, "<<subseq_sym<<
" <= "<<h<<
'\n';
80 }
catch(
const std::exception &e) {
81 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
bool ConvertStringToInteger(const std::string &str, Int *out)
Converts a string into an integer via strtoll and returns false if there was any kind of problem (i...
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.
void AddSubsequentialLoop(StdArc::Label subseq_symbol, MutableFst< StdArc > *fst)
Modifies an FST so that it transuces the same paths, but the input side of the paths can all have the...
std::string GetArg(int param) const
Returns one of the positional parameters; 1-based indexing for argc/argv compatibility.
int NumArgs() const
Number of positional parameters (c.f. argc-1).
Arc::Label HighestNumberedInputSymbol(const Fst< Arc > &fst)
Returns the highest numbered input symbol id of the FST (or zero for an empty FST.
int main(int argc, char *argv[])
void WriteFstKaldi(std::ostream &os, bool binary, const VectorFst< Arc > &t)
void ReadFstKaldi(std::istream &is, bool binary, VectorFst< Arc > *fst)
std::string GetOptArg(int param) const