82     using namespace kaldi;
   101         "Composition, where the right FST has \"failure\" (phi) transitions\n"   102         "that are only taken where there was no match of a \"real\" label\n"   103         "You supply the label corresponding to phi.\n"   105         "Usage:  fstphicompose phi-label (fst1-rxfilename|fst1-rspecifier) "   106         "(fst2-rxfilename|fst2-rspecifier) [(out-rxfilename|out-rspecifier)]\n"   107         "E.g.: fstphicompose 54 a.fst b.fst c.fst\n"   108         "or: fstphicompose 11 ark:a.fsts G.fst ark:b.fsts\n";
   114     if (po.NumArgs() < 3 || po.NumArgs() > 4) {
   120         phi_str = po.GetArg(1),
   121         fst1_in_str = po.GetArg(2),
   122         fst2_in_str = po.GetArg(3),
   123         fst_out_str = po.GetOptArg(4);
   135       KALDI_ERR << 
"Invalid first argument (phi label), expect positive integer.";
   137     if (is_table_out != (is_table_1 || is_table_2))
   138       KALDI_ERR << 
"Incompatible combination of archives and files";
   140     if (!is_table_1 && !is_table_2) { 
   148       VectorFst<StdArc> composed_fst;
   150       PhiCompose(*fst1, *fst2, phi_label, &composed_fst);
   157     } 
else if (is_table_1 && !is_table_2) {
   165       for (; !fst1_reader.Done(); fst1_reader.Next(), n_done++) {
   166         VectorFst<StdArc> fst1(fst1_reader.Value());
   167         VectorFst<StdArc> fst_out;
   169         fst_writer.Write(fst1_reader.Key(), fst_out);
   171       KALDI_LOG << 
"Composed " << n_done << 
" FSTs.";
   172       return (n_done != 0 ? 0 : 1);
   174       KALDI_ERR << 
"The combination of tables/non-tables that you "   175                 << 
"supplied is not currently supported.  Either implement this, "   176                 << 
"ask the maintainers to implement it, or call this program "   179   } 
catch(
const std::exception &e) {
   180     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...
 
void PropagateFinal(typename Arc::Label phi_label, MutableFst< Arc > *fst)
 
For an extended explanation of the framework of which grammar-fsts are a part, please see Support for...
 
void PhiCompose(const Fst< Arc > &fst1, const Fst< Arc > &fst2, typename Arc::Label phi_label, MutableFst< Arc > *ofst)
 
A templated class for writing objects to an archive or script file; see The Table concept...
 
RspecifierType ClassifyRspecifier(const std::string &rspecifier, std::string *rxfilename, RspecifierOptions *opts)
 
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
 
A templated class for reading objects sequentially from an archive or script file; see The Table conc...
 
WspecifierType ClassifyWspecifier(const std::string &wspecifier, std::string *archive_wxfilename, std::string *script_wxfilename, WspecifierOptions *opts)
 
void WriteFstKaldi(std::ostream &os, bool binary, const VectorFst< Arc > &t)
 
void ReadFstKaldi(std::istream &is, bool binary, VectorFst< Arc > *fst)