Home | History | Annotate | Download | only in fst

Lines Matching refs:mapper

52 //   StateMapper(const StateMapper &mapper, const Fst<A> *fst = 0);
70 // // Specifies input symbol table action the mapper requires (see above).
72 // // Specifies output symbol table action the mapper requires (see above).
75 // // mapper. It takes as argument the input Fst's known properties.
82 // we pass the mapper. We allow passing the mapper by pointer
83 // for cases that we need to change the state of the user's mapper.
84 // We also include map versions that pass the mapper
87 // Maps an arc type A using a mapper function object C, passed
90 void StateMap(MutableFst<A> *fst, C* mapper) {
94 if (mapper->InputSymbolsAction() == MAP_CLEAR_SYMBOLS)
97 if (mapper->OutputSymbolsAction() == MAP_CLEAR_SYMBOLS)
105 fst->SetStart(mapper->Start());
108 mapper->SetState(s);
110 for (; !mapper->Done(); mapper->Next())
111 fst->AddArc(s, mapper->Value());
112 fst->SetFinal(s, mapper->Final(s));
115 fst->SetProperties(mapper->Properties(props), kFstProperties);
118 // Maps an arc type A using a mapper function object C, passed
121 void StateMap(MutableFst<A> *fst, C mapper) {
122 StateMap(fst, &mapper);
126 // Maps an arc type A to an arc type B using mapper function
130 void StateMap(const Fst<A> &ifst, MutableFst<B> *ofst, C* mapper) {
136 if (mapper->InputSymbolsAction() == MAP_COPY_SYMBOLS)
138 else if (mapper->InputSymbolsAction() == MAP_CLEAR_SYMBOLS)
141 if (mapper->OutputSymbolsAction() == MAP_COPY_SYMBOLS)
143 else if (mapper->OutputSymbolsAction() == MAP_CLEAR_SYMBOLS)
159 ofst->SetStart(mapper->Start());
163 mapper->SetState(s);
164 for (; !mapper->Done(); mapper->Next())
165 ofst->AddArc(s, mapper->Value());
166 ofst->SetFinal(s, mapper->Final(s));
170 ofst->SetProperties(mapper->Properties(iprops) | oprops, kFstProperties);
173 // Maps an arc type A to an arc type B using mapper function
177 void StateMap(const Fst<A> &ifst, MutableFst<B> *ofst, C mapper) {
178 StateMap(ifst, ofst, &mapper);
208 StateMapFstImpl(const Fst<A> &fst, const C &mapper,
212 mapper_(new C(mapper, fst_)),
217 StateMapFstImpl(const Fst<A> &fst, C *mapper,
221 mapper_(mapper),
326 // Maps an arc type A to an arc type B using Mapper function object
339 StateMapFst(const Fst<A> &fst, const C &mapper,
341 : ImplToFst<Impl>(new Impl(fst, mapper, opts)) {}
343 StateMapFst(const Fst<A> &fst, C* mapper, const StateMapFstOptions& opts)
344 : ImplToFst<Impl>(new Impl(fst, mapper, opts)) {}
346 StateMapFst(const Fst<A> &fst, const C &mapper)
347 : ImplToFst<Impl>(new Impl(fst, mapper, StateMapFstOptions())) {}
349 StateMapFst(const Fst<A> &fst, C* mapper)
350 : ImplToFst<Impl>(new Impl(fst, mapper, StateMapFstOptions())) {}
398 // Mapper that returns its input.
411 IdentityStateMapper(const IdentityStateMapper<A> &mapper,
413 : fst_(fst ? *fst : mapper.fst_), aiter_(0) {}
452 ArcSumMapper(const ArcSumMapper<A> &mapper,
454 : fst_(fst ? *fst : mapper.fst_), i_(0) {}
536 ArcUniqueMapper(const ArcUniqueMapper<A> &mapper,
538 : fst_(fst ? *fst : mapper.fst_), i_(0) {}