Lines Matching refs:mapper

66   // (They may set by the mapper).
81 // // Specifies final action the mapper requires (see above).
82 // // The mapper will be passed final weights as arcs of the
85 // // Specifies input symbol table action the mapper requires (see above).
87 // // Specifies output symbol table action the mapper requires (see above).
90 // // mapper. It takes as argument the input Fst's known properties.
95 // method of the mapper to determine how to treat final weights,
102 // we pass the mapper. We allow passing the mapper by pointer
103 // for cases that we need to change the state of the user's mapper.
104 // This is the case with the encode mapper, which is reused during
105 // decoding. We also include map versions that pass the mapper
109 // Maps an arc type A using a mapper function object C, passed
112 void ArcMap(MutableFst<A> *fst, C* mapper) {
116 if (mapper->InputSymbolsAction() == MAP_CLEAR_SYMBOLS)
119 if (mapper->OutputSymbolsAction() == MAP_CLEAR_SYMBOLS)
127 MapFinalAction final_action = mapper->FinalAction();
138 aiter.SetValue((*mapper)(arc));
144 A final_arc = (*mapper)(A(0, 0, fst->Final(s), kNoStateId));
155 A final_arc = (*mapper)(A(0, 0, fst->Final(s), kNoStateId));
173 A final_arc = (*mapper)(A(0, 0, fst->Final(s), kNoStateId));
184 fst->SetProperties(mapper->Properties(props), kFstProperties);
188 // Maps an arc type A using a mapper function object C, passed
191 void ArcMap(MutableFst<A> *fst, C mapper) {
192 ArcMap(fst, &mapper);
196 // Maps an arc type A to an arc type B using mapper function
200 void ArcMap(const Fst<A> &ifst, MutableFst<B> *ofst, C* mapper) {
206 if (mapper->InputSymbolsAction() == MAP_COPY_SYMBOLS)
208 else if (mapper->InputSymbolsAction() == MAP_CLEAR_SYMBOLS)
211 if (mapper->OutputSymbolsAction() == MAP_COPY_SYMBOLS)
213 else if (mapper->OutputSymbolsAction() == MAP_CLEAR_SYMBOLS)
223 MapFinalAction final_action = mapper->FinalAction();
245 ofst->AddArc(s, (*mapper)(aiter.Value()));
250 B final_arc = (*mapper)(A(0, 0, ifst.Final(s), kNoStateId));
259 B final_arc = (*mapper)(A(0, 0, ifst.Final(s), kNoStateId));
275 B final_arc = (*mapper)(A(0, 0, ifst.Final(s), kNoStateId));
286 ofst->SetProperties(mapper->Properties(iprops) | oprops, kFstProperties);
289 // Maps an arc type A to an arc type B using mapper function
293 void ArcMap(const Fst<A> &ifst, MutableFst<B> *ofst, C mapper) {
294 ArcMap(ifst, ofst, &mapper);
332 ArcMapFstImpl(const Fst<A> &fst, const C &mapper,
336 mapper_(new C(mapper)),
343 ArcMapFstImpl(const Fst<A> &fst, C *mapper,
347 mapper_(mapper),
562 ArcMapFst(const Fst<A> &fst, const C &mapper, const ArcMapFstOptions& opts)
563 : ImplToFst<Impl>(new Impl(fst, mapper, opts)) {}
565 ArcMapFst(const Fst<A> &fst, C* mapper, const ArcMapFstOptions& opts)
566 : ImplToFst<Impl>(new Impl(fst, mapper, opts)) {}
568 ArcMapFst(const Fst<A> &fst, const C &mapper)
569 : ImplToFst<Impl>(new Impl(fst, mapper, ArcMapFstOptions())) {}
571 ArcMapFst(const Fst<A> &fst, C* mapper)
572 : ImplToFst<Impl>(new Impl(fst, mapper, ArcMapFstOptions())) {}