Lines Matching refs:Label
44 void Replace(const vector<pair<typename Arc::Label, const Fst<Arc>* > >&,
45 MutableFst<Arc> *, typename Arc::Label, bool);
57 typedef typename Arc::Label Label; typedef
61 typedef pair<Label, const Fst<Arc>*> FstPair;
62 typedef pair<Label, MutableFst<Arc>*> MutableFstPair;
63 typedef unordered_map<Label, Label> NonTerminalHash;
67 Label root_label, bool epsilon_on_replace = false);
71 Label root_label, bool epsilon_on_replace = false);
75 const NonTerminalHash &nonterminal_hash, Label root_fst,
79 for (Label i = 0; i < fst_array_.size(); ++i) in ~ReplaceUtil()
94 for (Label i = 0; i < fst_array_.size(); ++i) { in Connected()
108 void ReplaceLabels(const vector<Label> &labels);
140 Label nnonterms; // # of non-terminals in Fst
144 map<Label, size_t> inref;
146 map<Label, size_t> outref;
171 bool GetTopOrder(const Fst<Arc> &fst, vector<Label> *toporder) const;
174 void UpdateStats(Label j);
176 Label root_label_; // root non-terminal
177 Label root_fst_; // root Fst ID
181 vector<Label> nonterminal_array_; // Fst ID to non-terminal
194 Label root_label, bool epsilon_on_replace) in ReplaceUtil()
202 for (Label i = 0; i < fst_pairs.size(); ++i) { in ReplaceUtil()
203 Label label = fst_pairs[i].first; in ReplaceUtil()
218 Label root_label, bool epsilon_on_replace) in ReplaceUtil()
225 for (Label i = 0; i < fst_pairs.size(); ++i) { in ReplaceUtil()
226 Label label = fst_pairs[i].first; in ReplaceUtil()
240 const NonTerminalHash &nonterminal_hash, Label root_fst, in ReplaceUtil()
249 for (Label i = 1; i < fst_array.size(); ++i) in ReplaceUtil()
270 for (Label i = 0; i < fst_array_.size(); ++i) { in GetDependencies()
280 for (Label i = 0; i < fst_array_.size(); ++i) { in GetDependencies()
300 Label j = it->second; in GetDependencies()
319 void ReplaceUtil<Arc>::UpdateStats(Label j) { in UpdateStats()
328 typedef typename map<Label, size_t>::iterator Iter; in UpdateStats()
332 Label i = in->first; in UpdateStats()
341 Label k = out->first; in UpdateStats()
350 Label k = out->first; in UpdateStats()
357 Label i = in->first; in UpdateStats()
368 for (Label i = 0; i < fst_array_.size(); ++i) { in CheckMutableFsts()
384 for (Label i = 0; i < mutable_fst_array_.size(); ++i) { in Connect()
391 for (Label i = 0; i < mutable_fst_array_.size(); ++i) { in Connect()
404 vector<Label> *toporder) const { in GetTopOrder()
417 for (Label i = 0; i < order.size(); ++i) in GetTopOrder()
424 void ReplaceUtil<Arc>::ReplaceLabels(const vector<Label> &labels) { in ReplaceLabels()
426 unordered_set<Label> label_set; in ReplaceLabels()
427 for (Label i = 0; i < labels.size(); ++i) in ReplaceLabels()
439 Label label = nonterminal_array_[arc.nextstate]; in ReplaceLabels()
448 vector<Label> toporder; in ReplaceLabels()
456 for (Label o = toporder.size() - 1; o >= 0; --o) { in ReplaceLabels()
462 Label label = nonterminal_array_[arc.nextstate]; in ReplaceLabels()
468 Label label = nonterminal_array_[s]; in ReplaceLabels()
480 vector<Label> labels; in ReplaceBySize()
483 vector<Label> toporder; in ReplaceBySize()
489 for (Label o = toporder.size() - 1; o >= 0; --o) { in ReplaceBySize()
490 Label j = toporder[o]; in ReplaceBySize()
503 vector<Label> labels; in ReplaceByInstances()
506 vector<Label> toporder; in ReplaceByInstances()
511 for (Label o = 0; o < toporder.size(); ++o) { in ReplaceByInstances()
512 Label j = toporder[o]; in ReplaceByInstances()
525 for (Label i = 0; i < fst_array_.size(); ++i) { in GetFstPairs()
526 Label label = nonterminal_array_[i]; in GetFstPairs()
539 for (Label i = 0; i < mutable_fst_array_.size(); ++i) { in GetMutableFstPairs()
540 Label label = nonterminal_array_[i]; in GetMutableFstPairs()