FST  openfst-1.7.3
OpenFst Library
epsnormalize.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 void EpsNormalize(const FstClass &ifst, MutableFstClass *ofst,
13  EpsNormalizeType norm_type) {
14  if (!internal::ArcTypesMatch(ifst, *ofst, "EpsNormalize")) {
15  ofst->SetProperties(kError, kError);
16  return;
17  }
18  EpsNormalizeArgs args(ifst, ofst, norm_type);
19  Apply<Operation<EpsNormalizeArgs>>("EpsNormalize", ifst.ArcType(), &args);
20 }
21 
25 
26 } // namespace script
27 } // namespace fst
void EpsNormalize(EpsNormalizeArgs *args)
Definition: epsnormalize.h:19
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
EpsNormalizeType
Definition: epsnormalize.h:18
std::tuple< const FstClass &, MutableFstClass *, EpsNormalizeType > EpsNormalizeArgs
Definition: epsnormalize.h:16
constexpr uint64 kError
Definition: properties.h:34
void SetProperties(uint64 props, uint64 mask)
Definition: fst-class.h:465