22 #ifndef KALDI_FSTEXT_KALDI_FST_IO_H_ 23 #define KALDI_FSTEXT_KALDI_FST_IO_H_ 25 #include <fst/fstlib.h> 26 #include <fst/fst-decl.h> 27 #include <fst/script/print-impl.h> 51 bool throw_on_err =
true);
62 void ReadFstKaldi(std::string rxfilename, VectorFst<StdArc> *ofst);
68 std::string wxfilename);
76 const VectorFst<Arc> &
fst);
98 typedef VectorFst<Arc>
T;
102 static bool Write(std::ostream &os,
bool binary,
const T &t);
110 bool Read(std::istream &is);
121 if (!
t_)
KALDI_ERR <<
"VectorFstTplHolder::Value() called wrongly.";
137 const std::string &range) {
138 KALDI_ERR <<
"ExtractRange is not defined for this type of holder.";
bool Read(std::istream &is)
static bool Write(std::ostream &os, bool binary, const T &t)
Fst< StdArc > * ReadFstKaldiGeneric(std::string rxfilename, bool throw_on_err)
void Swap(VectorFstTplHolder< Arc > *other)
For an extended explanation of the framework of which grammar-fsts are a part, please see Support for...
VectorFstTplHolder< StdArc > VectorFstHolder
void swap(basic_filebuf< CharT, Traits > &x, basic_filebuf< CharT, Traits > &y)
bool ExtractRange(const VectorFstTplHolder< Arc > &other, const std::string &range)
KALDI_DISALLOW_COPY_AND_ASSIGN(VectorFstTplHolder)
fst::VectorFst< fst::StdArc > * ReadAndPrepareLmFst(std::string rxfilename)
void WriteFstKaldi(std::ostream &os, bool binary, const VectorFst< Arc > &t)
void ReadFstKaldi(std::istream &is, bool binary, VectorFst< Arc > *fst)
VectorFst< StdArc > * CastOrConvertToVectorFst(Fst< StdArc > *fst)
static bool IsReadInBinary()