18 #ifndef FST_SCRIPT_REPLACE_H_ 19 #define FST_SCRIPT_REPLACE_H_ 47 int64_t return_label = 0)
49 call_label_type(call_label_type),
50 return_label_type(return_label_type),
51 return_label(return_label) {}
55 std::tuple<const std::vector<std::pair<int64_t, const FstClass *>> &,
62 const auto &untyped_pairs = std::get<0>(*args);
63 std::vector<std::pair<typename Arc::Label, const Fst<Arc> *>> typed_pairs;
64 typed_pairs.reserve(untyped_pairs.size());
65 for (
const auto &untyped_pair : untyped_pairs) {
66 typed_pairs.emplace_back(untyped_pair.first,
67 untyped_pair.second->GetFst<Arc>());
70 const auto &opts = std::get<2>(*args);
72 opts.return_label_type, opts.return_label);
76 FSTERROR() <<
"Replace: Cyclic dependencies detected; cannot expand";
85 void Replace(
const std::vector<std::pair<int64_t, const FstClass *>> &pairs,
91 #endif // FST_SCRIPT_REPLACE_H_
void Replace(const std::vector< std::pair< int64_t, const FstClass * >> &pairs, MutableFstClass *ofst, std::vector< std::pair< int64_t, int64_t >> *parens, int64_t root, PdtParserType parser_type, int64_t start_paren_labels, const std::string &left_paren_prefix, const std::string &right_paren_prefix)
constexpr uint64_t kError
std::tuple< const std::vector< std::pair< int64_t, const FstClass * >> &, MutableFstClass *, const ReplaceOptions & > FstReplaceArgs
bool CyclicDependencies() const
const ReplaceLabelType call_label_type
const int64_t return_label
virtual void SetProperties(uint64_t props, uint64_t mask)=0
const ReplaceLabelType return_label_type
ReplaceOptions(int64_t root, ReplaceLabelType call_label_type=REPLACE_LABEL_INPUT, ReplaceLabelType return_label_type=REPLACE_LABEL_NEITHER, int64_t return_label=0)