// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #ifndef FST_SCRIPT_REWEIGHT_H_ #define FST_SCRIPT_REWEIGHT_H_ #include #include #include #include #include #include namespace fst { namespace script { using ReweightArgs = std::tuple &, ReweightType>; template void Reweight(ReweightArgs *args) { using Weight = typename Arc::Weight; MutableFst *fst = std::get<0>(*args)->GetMutableFst(); const std::vector &potentials = std::get<1>(*args); std::vector typed_potentials; internal::CopyWeights(potentials, &typed_potentials); Reweight(fst, typed_potentials, std::get<2>(*args)); } void Reweight(MutableFstClass *fst, const std::vector &potentials, ReweightType reweight_type); } // namespace script } // namespace fst #endif // FST_SCRIPT_REWEIGHT_H_