FST  openfst-1.7.2
OpenFst Library
equivalent.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>
7 
8 namespace fst {
9 namespace script {
10 
11 bool Equivalent(const FstClass &fst1, const FstClass &fst2, float delta) {
12  if (!internal::ArcTypesMatch(fst1, fst2, "Equivalent")) return false;
13  EquivalentInnerArgs iargs(fst1, fst2, delta);
14  EquivalentArgs args(iargs);
15  Apply<Operation<EquivalentArgs>>("Equivalent", fst1.ArcType(), &args);
16  return args.retval;
17 }
18 
22 
23 } // namespace script
24 } // namespace fst
void Equivalent(EquivalentArgs *args)
Definition: equivalent.h:22
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::tuple< const FstClass &, const FstClass &, float > EquivalentInnerArgs
Definition: equivalent.h:17