FST  openfst-1.7.7
OpenFst Library
determinize.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 
7 
8 namespace fst {
9 namespace script {
10 
11 void Determinize(const FstClass &ifst, MutableFstClass *ofst,
12  const DeterminizeOptions &opts) {
13  if (!internal::ArcTypesMatch(ifst, *ofst, "Determinize") ||
14  !ofst->WeightTypesMatch(opts.weight_threshold, "Determinize")) {
15  ofst->SetProperties(kError, kError);
16  return;
17  }
18  DeterminizeArgs args(ifst, ofst, opts);
19  Apply<Operation<DeterminizeArgs>>("Determinize", ifst.ArcType(), &args);
20 }
21 
23 
24 } // namespace script
25 } // namespace fst
bool WeightTypesMatch(const WeightClass &weight, const std::string &op_name) const
Definition: fst-class.cc:82
REGISTER_FST_OPERATION_3ARCS(Compress, CompressArgs)
const std::string & ArcType() const final
Definition: fst-class.h:300
std::tuple< const FstClass &, MutableFstClass *, const DeterminizeOptions & > DeterminizeArgs
Definition: determinize.h:38
bool ArcTypesMatch(const M &m, const N &n, const std::string &op_name)
Definition: script-impl.h:178
const WeightClass & weight_threshold
Definition: determinize.h:18
constexpr uint64 kError
Definition: properties.h:36
void Determinize(DeterminizeArgs *args)
Definition: determinize.h:41
void SetProperties(uint64 props, uint64 mask)
Definition: fst-class.h:467