FST  openfst-1.7.1
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 
4 #include <fst/script/fst-class.h>
7 
8 namespace fst {
9 namespace script {
10 
11 void EpsNormalize(const FstClass &ifst, MutableFstClass *ofst,
12  EpsNormalizeType norm_type) {
13  if (!internal::ArcTypesMatch(ifst, *ofst, "EpsNormalize")) {
14  ofst->SetProperties(kError, kError);
15  return;
16  }
17  EpsNormalizeArgs args(ifst, ofst, norm_type);
18  Apply<Operation<EpsNormalizeArgs>>("EpsNormalize", ifst.ArcType(), &args);
19 }
20 
24 
25 } // namespace script
26 } // namespace fst
void EpsNormalize(EpsNormalizeArgs *args)
Definition: epsnormalize.h:19
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
EpsNormalizeType
Definition: epsnormalize.h:18
std::tuple< const FstClass &, MutableFstClass *, EpsNormalizeType > EpsNormalizeArgs
Definition: epsnormalize.h:16
constexpr uint64 kError
Definition: properties.h:33
void SetProperties(uint64 props, uint64 mask)
Definition: fst-class.h:452