FST  openfst-1.7.7
OpenFst Library
reverse.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/reverse.h>
5 
7 
8 namespace fst {
9 namespace script {
10 
11 void Reverse(const FstClass &ifst, MutableFstClass *ofst,
12  bool require_superinitial) {
13  if (!internal::ArcTypesMatch(ifst, *ofst, "Reverse")) {
14  ofst->SetProperties(kError, kError);
15  return;
16  }
17  ReverseArgs args(ifst, ofst, require_superinitial);
18  Apply<Operation<ReverseArgs>>("Reverse", ifst.ArcType(), &args);
19 }
20 
22 
23 } // namespace script
24 } // namespace fst
REGISTER_FST_OPERATION_3ARCS(Compress, CompressArgs)
const std::string & ArcType() const final
Definition: fst-class.h:300
bool ArcTypesMatch(const M &m, const N &n, const std::string &op_name)
Definition: script-impl.h:178
void Reverse(ReverseArgs *args)
Definition: reverse.h:18
constexpr uint64 kError
Definition: properties.h:36
void SetProperties(uint64 props, uint64 mask)
Definition: fst-class.h:467
std::tuple< const FstClass &, MutableFstClass *, bool > ReverseArgs
Definition: reverse.h:15