FST  openfst-1.7.2
OpenFst Library
union.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>
6 #include <fst/script/union.h>
7 
8 namespace fst {
9 namespace script {
10 
11 void Union(MutableFstClass *fst1, const FstClass &fst2) {
12  if (!internal::ArcTypesMatch(*fst1, fst2, "Union")) {
13  fst1->SetProperties(kError, kError);
14  return;
15  }
16  UnionArgs args(fst1, fst2);
17  Apply<Operation<UnionArgs>>("Union", fst1->ArcType(), &args);
18 }
19 
23 
24 } // namespace script
25 } // 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< MutableFstClass *, const FstClass & > UnionArgs
Definition: union.h:15
void Union(UnionArgs *args)
Definition: union.h:18
constexpr uint64 kError
Definition: properties.h:33
void SetProperties(uint64 props, uint64 mask)
Definition: fst-class.h:452