FST  openfst-1.7.1
OpenFst Library
decode.cc
Go to the documentation of this file.
1 // See www.openfst.org for extensive documentation on this weighted
2 // finite-state transducer library.
3 
4 #include <fst/script/fst-class.h>
5 #include <fst/encode.h>
6 #include <fst/script/decode.h>
8 
9 namespace fst {
10 namespace script {
11 
12 void Decode(MutableFstClass *fst, const string &coder_fname) {
13  DecodeArgs1 args(fst, coder_fname);
14  Apply<Operation<DecodeArgs1>>("Decode", fst->ArcType(), &args);
15 }
16 
17 void Decode(MutableFstClass *fst, const EncodeMapperClass &encoder) {
18  if (!internal::ArcTypesMatch(*fst, encoder, "Decode")) {
20  return;
21  }
22  DecodeArgs2 args(fst, encoder);
23  Apply<Operation<DecodeArgs2>>("Decode", fst->ArcType(), &args);
24 }
25 
29 
33 
34 } // namespace script
35 } // namespace fst
void Decode(DecodeArgs1 *args)
Definition: decode.h:21
std::pair< MutableFstClass *, const EncodeMapperClass & > DecodeArgs2
Definition: decode.h:32
const string & ArcType() const final
Definition: fst-class.h:290
REGISTER_FST_OPERATION(Compress, StdArc, CompressArgs)
bool ArcTypesMatch(const M &m, const N &n, const string &op_name)
Definition: script-impl.h:176
constexpr uint64 kError
Definition: properties.h:33
void SetProperties(uint64 props, uint64 mask)
Definition: fst-class.h:452
std::pair< MutableFstClass *, const string & > DecodeArgs1
Definition: decode.h:18