FST  openfst-1.7.3
OpenFst Library
encode.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/encode.h>
5 
6 #include <fst/script/encode.h>
7 #include <fst/script/fst-class.h>
9 
10 namespace fst {
11 namespace script {
12 
13 void Encode(MutableFstClass *fst, uint32 flags, bool reuse_encoder,
14  const std::string &coder_fname) {
15  EncodeArgs1 args(fst, flags, reuse_encoder, coder_fname);
16  Apply<Operation<EncodeArgs1>>("Encode", fst->ArcType(), &args);
17 }
18 
20  if (!internal::ArcTypesMatch(*fst, *encoder, "Encode")) {
22  return;
23  }
24  EncodeArgs2 args(fst, encoder);
25  Apply<Operation<EncodeArgs2>>("Encode", fst->ArcType(), &args);
26 }
27 
31 
35 
36 } // namespace script
37 } // namespace fst
void Encode(EncodeArgs1 *args)
Definition: encode.h:23
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 *, EncodeMapperClass * > EncodeArgs2
Definition: encode.h:35
uint32_t uint32
Definition: types.h:31
std::tuple< MutableFstClass *, uint32, bool, const std::string & > EncodeArgs1
Definition: encode.h:20
constexpr uint64 kError
Definition: properties.h:34
void SetProperties(uint64 props, uint64 mask)
Definition: fst-class.h:465