FST  openfst-1.7.2
OpenFst Library
minimize.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>
5 #include <fst/script/minimize.h>
7 
8 namespace fst {
9 namespace script {
10 
11 void Minimize(MutableFstClass *ofst1, MutableFstClass *ofst2, float delta,
12  bool allow_nondet) {
13  if (ofst2 && !internal::ArcTypesMatch(*ofst1, *ofst2, "Minimize")) {
14  ofst1->SetProperties(kError, kError);
15  ofst2->SetProperties(kError, kError);
16  return;
17  }
18  MinimizeArgs args(ofst1, ofst2, delta, allow_nondet);
19  Apply<Operation<MinimizeArgs>>("Minimize", ofst1->ArcType(), &args);
20 }
21 
25 
26 } // namespace script
27 } // namespace fst
void Minimize(MinimizeArgs *args)
Definition: minimize.h:19
std::tuple< MutableFstClass *, MutableFstClass *, float, bool > MinimizeArgs
Definition: minimize.h:16
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
constexpr uint64 kError
Definition: properties.h:33
void SetProperties(uint64 props, uint64 mask)
Definition: fst-class.h:452