FST  openfst-1.7.3
OpenFst Library
concat.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/concat.h>
5 
6 #include <fst/script/fst-class.h>
8 
9 namespace fst {
10 namespace script {
11 
12 // 1
13 void Concat(MutableFstClass *ofst, const FstClass &ifst) {
14  if (!internal::ArcTypesMatch(*ofst, ifst, "Concat")) {
15  ofst->SetProperties(kError, kError);
16  return;
17  }
18  ConcatArgs1 args(ofst, ifst);
19  Apply<Operation<ConcatArgs1>>("Concat", ofst->ArcType(), &args);
20 }
21 
22 // 2
23 void Concat(const FstClass &ifst, MutableFstClass *ofst) {
24  if (!internal::ArcTypesMatch(ifst, *ofst, "Concat")) {
25  ofst->SetProperties(kError, kError);
26  return;
27  }
28  ConcatArgs2 args(ifst, ofst);
29  Apply<Operation<ConcatArgs2>>("Concat", ofst->ArcType(), &args);
30 }
31 
35 
39 
40 } // namespace script
41 } // namespace fst
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< const FstClass &, MutableFstClass * > ConcatArgs2
Definition: concat.h:24
constexpr uint64 kError
Definition: properties.h:34
void SetProperties(uint64 props, uint64 mask)
Definition: fst-class.h:465
std::pair< MutableFstClass *, const FstClass & > ConcatArgs1
Definition: concat.h:15
void Concat(ConcatArgs1 *args)
Definition: concat.h:18