FST  openfst-1.7.3
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/decode.h>
5 
6 #include <fst/encode.h>
7 #include <fst/script/fst-class.h>
9 
10 namespace fst {
11 namespace script {
12 
13 void Decode(MutableFstClass *fst, const std::string &coder_fname) {
14  DecodeArgs1 args(fst, coder_fname);
15  Apply<Operation<DecodeArgs1>>("Decode", fst->ArcType(), &args);
16 }
17 
18 void Decode(MutableFstClass *fst, const EncodeMapperClass &encoder) {
19  if (!internal::ArcTypesMatch(*fst, encoder, "Decode")) {
21  return;
22  }
23  DecodeArgs2 args(fst, encoder);
24  Apply<Operation<DecodeArgs2>>("Decode", fst->ArcType(), &args);
25 }
26 
30 
34 
35 } // namespace script
36 } // namespace fst
void Decode(DecodeArgs1 *args)
Definition: decode.h:21
std::pair< MutableFstClass *, const EncodeMapperClass & > DecodeArgs2
Definition: decode.h:32
const std::string & ArcType() const final
Definition: fst-class.h:298
REGISTER_FST_OPERATION(Compress, StdArc, CompressArgs)
bool ArcTypesMatch(const M &m, const N &n, const std::string &op_name)
Definition: script-impl.h:177
std::pair< MutableFstClass *, const std::string & > DecodeArgs1
Definition: decode.h:18
constexpr uint64 kError
Definition: properties.h:34
void SetProperties(uint64 props, uint64 mask)
Definition: fst-class.h:465