Lines Matching refs:ReplaceFst
31 // By default ReplaceFst will copy the input label of the 'replace arc'.
157 LOG(FATAL) << "ReplaceFst::AddFst input symbols of Fst " << i-1
161 LOG(FATAL) << "ReplaceFst::AddFst output symbols of Fst " << i-1
510 // \class ReplaceFst
514 // ReplaceFst supports dynamic replacement of arcs in one Fst with
515 // another Fst. This replacement is recursive. ReplaceFst can be used
521 // Fst. Currently the ReplaceFst uses the output symbols of the arcs
533 class ReplaceFst : public Fst<A> {
535 friend class ArcIterator< ReplaceFst<A> >;
536 friend class CacheStateIterator< ReplaceFst<A> >;
537 friend class CacheArcIterator< ReplaceFst<A> >;
545 ReplaceFst(const vector<pair<Label, const Fst<A>* > >& fst_array,
549 ReplaceFst(const vector<pair<Label, const Fst<A>* > >& fst_array,
553 ReplaceFst(const ReplaceFst<A>& fst) :
556 virtual ~ReplaceFst() {
594 virtual ReplaceFst<A>* Copy() const {
595 return new ReplaceFst<A>(*this);
621 // Specialization for ReplaceFst.
623 class StateIterator< ReplaceFst<A> >
624 : public CacheStateIterator< ReplaceFst<A> > {
626 explicit StateIterator(const ReplaceFst<A> &fst)
627 : CacheStateIterator< ReplaceFst<A> >(fst) {}
633 // Specialization for ReplaceFst.
635 class ArcIterator< ReplaceFst<A> >
636 : public CacheArcIterator< ReplaceFst<A> > {
640 ArcIterator(const ReplaceFst<A> &fst, StateId s)
641 : CacheArcIterator< ReplaceFst<A> >(fst, s) {
651 void ReplaceFst<A>::InitStateIterator(StateIteratorData<A> *data) const {
652 data->base = new StateIterator< ReplaceFst<A> >(*this);
655 typedef ReplaceFst<StdArc> StdReplaceFst;
677 *ofst = ReplaceFst<Arc>(ifst_array, opts);