All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
TrivialFactorWeightFst< A, F > Class Template Reference

FactorWeightFst takes as template parameter a FactorIterator as defined above. More...

#include <trivial-factor-weight.h>

Inheritance diagram for TrivialFactorWeightFst< A, F >:
Collaboration diagram for TrivialFactorWeightFst< A, F >:

Public Types

typedef A Arc
typedef A::Weight Weight
typedef A::StateId StateId
typedef CacheState< A > State
TrivialFactorWeightFstImpl< A,
F > 

Public Member Functions

 TrivialFactorWeightFst (const Fst< A > &fst)
 TrivialFactorWeightFst (const Fst< A > &fst, const TrivialFactorWeightOptions< A > &opts)
 TrivialFactorWeightFst (const TrivialFactorWeightFst< A, F > &fst, bool copy)
virtual TrivialFactorWeightFst
< A, F > * 
Copy (bool copy=false) const
virtual void InitStateIterator (StateIteratorData< A > *data) const
virtual void InitArcIterator (StateId s, ArcIteratorData< A > *data) const

Private Member Functions

ImplGetImpl () const
void operator= (const TrivialFactorWeightFst< A, F > &fst)


class ArcIterator< TrivialFactorWeightFst< A, F > >
class StateIterator< TrivialFactorWeightFst< A, F > >

Detailed Description

template<class A, class F>
class fst::TrivialFactorWeightFst< A, F >

FactorWeightFst takes as template parameter a FactorIterator as defined above.

The result of weight factoring is a transducer equivalent to the input whose path weights have been factored according to the FactorIterator. States and transitions will be added as necessary. This algorithm differs from the one implemented in FactorWeightFst in that it does not attempt to push the extra weight forward to the next state: it uses a sequence of "extra" intermediate state, and outputs the remaining weight right away. This ensures that it will always succeed, even for Gallic representations of FSTs that have cycles with more output than input symbols. Note that the code below was modified from factor-weight.h by just search-and-replacing "FactorWeight" by "TrivialFactorWeight".

Definition at line 339 of file trivial-factor-weight.h.

Member Typedef Documentation

typedef A Arc

Definition at line 344 of file trivial-factor-weight.h.

Definition at line 353 of file trivial-factor-weight.h.

typedef CacheState<A> State

Definition at line 351 of file trivial-factor-weight.h.

typedef A::StateId StateId

Definition at line 346 of file trivial-factor-weight.h.

typedef A::Weight Weight

Definition at line 345 of file trivial-factor-weight.h.

Constructor & Destructor Documentation

TrivialFactorWeightFst ( const Fst< A > &  fst)

Definition at line 355 of file trivial-factor-weight.h.

356  : ImplToFst<Impl>(new Impl(fst, TrivialFactorWeightOptions<A>())) {}
TrivialFactorWeightFstImpl< A, F > Impl
TrivialFactorWeightFst ( const Fst< A > &  fst,
const TrivialFactorWeightOptions< A > &  opts 

Definition at line 358 of file trivial-factor-weight.h.

359  : ImplToFst<Impl>(new Impl(fst, opts)) {}
TrivialFactorWeightFstImpl< A, F > Impl
TrivialFactorWeightFst ( const TrivialFactorWeightFst< A, F > &  fst,
bool  copy 

Definition at line 362 of file trivial-factor-weight.h.

363  : ImplToFst<Impl>(fst, copy) {}
Definition: graph.dox:21

Member Function Documentation

virtual TrivialFactorWeightFst<A, F>* Copy ( bool  copy = false) const

Definition at line 366 of file trivial-factor-weight.h.

366  {
367  return new TrivialFactorWeightFst<A, F>(*this, copy);
368  }
virtual void InitArcIterator ( StateId  s,
ArcIteratorData< A > *  data 
) const

Definition at line 372 of file trivial-factor-weight.h.

References TrivialFactorWeightFst< A, F >::GetImpl(), and TrivialFactorWeightFstImpl< A, F >::InitArcIterator().

372  {
373  GetImpl()->InitArcIterator(s, data);
374  }
void InitArcIterator(StateId s, ArcIteratorData< A > *data)
void InitStateIterator ( StateIteratorData< A > *  data) const

Definition at line 412 of file trivial-factor-weight.h.

413 {
414  data->base = new StateIterator< TrivialFactorWeightFst<A, F> >(*this);
415 }
void operator= ( const TrivialFactorWeightFst< A, F > &  fst)

Friends And Related Function Documentation

friend class ArcIterator< TrivialFactorWeightFst< A, F > >

Definition at line 341 of file trivial-factor-weight.h.

friend class StateIterator< TrivialFactorWeightFst< A, F > >

Definition at line 342 of file trivial-factor-weight.h.

The documentation for this class was generated from the following file: