// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #ifndef FST_SCRIPT_PRUNE_H_ #define FST_SCRIPT_PRUNE_H_ #include #include #include #include #include namespace fst { namespace script { using PruneArgs1 = std::tuple; template void Prune(PruneArgs1 *args) { using Weight = typename Arc::Weight; const Fst &ifst = *(std::get<0>(*args).GetFst()); MutableFst *ofst = std::get<1>(*args)->GetMutableFst(); const auto weight_threshold = *(std::get<2>(*args).GetWeight()); Prune(ifst, ofst, weight_threshold, std::get<3>(*args), std::get<4>(*args)); } using PruneArgs2 = std::tuple; template void Prune(PruneArgs2 *args) { using Weight = typename Arc::Weight; MutableFst *fst = std::get<0>(*args)->GetMutableFst(); const auto weight_threshold = *(std::get<1>(*args).GetWeight()); Prune(fst, weight_threshold, std::get<2>(*args), std::get<3>(*args)); } void Prune(const FstClass &ifst, MutableFstClass *ofst, const WeightClass &weight_threshold, int64 state_threshold = kNoStateId, float delta = kDelta); void Prune(MutableFstClass *fst, const WeightClass &weight_threshold, int64 state_threshold = kNoStateId, float delta = kDelta); } // namespace script } // namespace fst #endif // FST_SCRIPT_PRUNE_H_