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