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

TrivialFactorWeightFst 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 DefaultCacheStore< ArcStore
 
typedef Store::State State
 
typedef
internal::TrivialFactorWeightFstImpl
< A, F > 
Impl
 

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)
 
TrivialFactorWeightFst< A, F > * Copy (bool copy=false) const override
 
void InitStateIterator (StateIteratorData< A > *data) const override
 
void InitArcIterator (StateId s, ArcIteratorData< A > *data) const override
 

Private Member Functions

TrivialFactorWeightFstoperator= (const TrivialFactorWeightFst &fst)=delete
 

Friends

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

Detailed Description

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

TrivialFactorWeightFst 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 325 of file trivial-factor-weight.h.

Member Typedef Documentation

typedef A Arc

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

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

typedef Store::State State

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

typedef A::StateId StateId

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

typedef DefaultCacheStore<Arc> Store

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

typedef A::Weight Weight

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

Constructor & Destructor Documentation

TrivialFactorWeightFst ( const Fst< A > &  fst)
inlineexplicit

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

339  : ImplToFst<Impl>(std::make_shared<Impl>(fst, TrivialFactorWeightOptions<A>())) {}
Definition: graph.dox:21
TrivialFactorWeightFst ( const Fst< A > &  fst,
const TrivialFactorWeightOptions< A > &  opts 
)
inline

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

342  : ImplToFst<Impl>(std::make_shared<Impl>(fst, opts)) {}
Definition: graph.dox:21
TrivialFactorWeightFst ( const TrivialFactorWeightFst< A, F > &  fst,
bool  copy 
)
inline

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

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

Member Function Documentation

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

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

349  {
350  return new TrivialFactorWeightFst<A, F>(*this, copy);
351  }
void InitArcIterator ( StateId  s,
ArcIteratorData< A > *  data 
) const
inlineoverride

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

355  {
356  GetMutableImpl()->InitArcIterator(s, data);
357  }
void InitStateIterator ( StateIteratorData< A > *  data) const
inlineoverride

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

392  {
393  data->base = new StateIterator< TrivialFactorWeightFst<A, F> >(*this);
394 }
TrivialFactorWeightFst& operator= ( const TrivialFactorWeightFst< A, F > &  fst)
privatedelete

Friends And Related Function Documentation

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

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

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

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


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