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