FST  openfst-1.8.3
OpenFst Library
Public Types | Public Member Functions | Protected Member Functions | List of all members
fst::PdtParser< Arc > Class Template Referenceabstract

#include <replace.h>

Inheritance diagram for fst::PdtParser< Arc >:
Inheritance graph
[legend]

Public Types

using Label = typename Arc::Label
 
using StateId = typename Arc::StateId
 
using Weight = typename Arc::Weight
 
using LabelFstPair = std::pair< Label, const Fst< Arc > * >
 
using LabelPair = std::pair< Label, Label >
 
using LabelStatePair = std::pair< Label, StateId >
 
using StateWeightPair = std::pair< StateId, Weight >
 
using ParenKey = std::pair< size_t, StateId >
 
using ParenMap = std::unordered_map< ParenKey, size_t, internal::ReplaceParenHash< StateId >>
 

Public Member Functions

 PdtParser (const std::vector< LabelFstPair > &fst_array, const PdtReplaceOptions< Arc > &opts)
 
virtual ~PdtParser ()
 
virtual void GetParser (MutableFst< Arc > *ofst, std::vector< LabelPair > *parens)=0
 

Protected Member Functions

const std::vector< LabelFstPair > & FstArray () const
 
Label Root () const
 
StateId Label2Id (Label l) const
 
LabelStatePair GetLabelStatePair (StateId os) const
 
StateId GetState (const LabelStatePair &lsp) const
 
void CreateFst (MutableFst< Arc > *ofst, std::vector< StateId > *open_dest, std::vector< std::vector< StateWeightPair >> *close_src)
 
void AssignParenLabels (size_t total_nparens, std::vector< LabelPair > *parens)
 
virtual size_t AssignParenIds (const Fst< Arc > &ofst, ParenMap *paren_map) const =0
 
void AddParensToFst (const std::vector< LabelPair > &parens, const ParenMap &paren_map, const std::vector< StateId > &open_dest, const std::vector< std::vector< StateWeightPair >> &close_src, const std::vector< bool > &close_non_term_weight, MutableFst< Arc > *ofst)
 
void AddParensToSymbolTables (const std::vector< LabelPair > &parens, MutableFst< Arc > *ofst)
 

Detailed Description

template<class Arc>
class fst::PdtParser< Arc >

Definition at line 115 of file replace.h.

Member Typedef Documentation

template<class Arc>
using fst::PdtParser< Arc >::Label = typename Arc::Label

Definition at line 117 of file replace.h.

template<class Arc>
using fst::PdtParser< Arc >::LabelFstPair = std::pair<Label, const Fst<Arc> *>

Definition at line 120 of file replace.h.

template<class Arc>
using fst::PdtParser< Arc >::LabelPair = std::pair<Label, Label>

Definition at line 121 of file replace.h.

template<class Arc>
using fst::PdtParser< Arc >::LabelStatePair = std::pair<Label, StateId>

Definition at line 122 of file replace.h.

template<class Arc>
using fst::PdtParser< Arc >::ParenKey = std::pair<size_t, StateId>

Definition at line 124 of file replace.h.

template<class Arc>
using fst::PdtParser< Arc >::ParenMap = std::unordered_map<ParenKey, size_t, internal::ReplaceParenHash<StateId>>

Definition at line 126 of file replace.h.

template<class Arc>
using fst::PdtParser< Arc >::StateId = typename Arc::StateId

Definition at line 118 of file replace.h.

template<class Arc>
using fst::PdtParser< Arc >::StateWeightPair = std::pair<StateId, Weight>

Definition at line 123 of file replace.h.

template<class Arc>
using fst::PdtParser< Arc >::Weight = typename Arc::Weight

Definition at line 119 of file replace.h.

Constructor & Destructor Documentation

template<class Arc>
fst::PdtParser< Arc >::PdtParser ( const std::vector< LabelFstPair > &  fst_array,
const PdtReplaceOptions< Arc > &  opts 
)
inline

Definition at line 128 of file replace.h.

template<class Arc>
virtual fst::PdtParser< Arc >::~PdtParser ( )
inlinevirtual

Definition at line 154 of file replace.h.

Member Function Documentation

template<class Arc >
void fst::PdtParser< Arc >::AddParensToFst ( const std::vector< LabelPair > &  parens,
const ParenMap paren_map,
const std::vector< StateId > &  open_dest,
const std::vector< std::vector< StateWeightPair >> &  close_src,
const std::vector< bool > &  close_non_term_weight,
MutableFst< Arc > *  ofst 
)
protected

Definition at line 314 of file replace.h.

template<class Arc >
void fst::PdtParser< Arc >::AddParensToSymbolTables ( const std::vector< LabelPair > &  parens,
MutableFst< Arc > *  ofst 
)
protected

Definition at line 375 of file replace.h.

template<class Arc>
virtual size_t fst::PdtParser< Arc >::AssignParenIds ( const Fst< Arc > &  ofst,
ParenMap paren_map 
) const
protectedpure virtual
template<class Arc>
void fst::PdtParser< Arc >::AssignParenLabels ( size_t  total_nparens,
std::vector< LabelPair > *  parens 
)
inlineprotected

Definition at line 203 of file replace.h.

template<class Arc >
void fst::PdtParser< Arc >::CreateFst ( MutableFst< Arc > *  ofst,
std::vector< StateId > *  open_dest,
std::vector< std::vector< StateWeightPair >> *  close_src 
)
protected

Definition at line 256 of file replace.h.

template<class Arc>
const std::vector<LabelFstPair>& fst::PdtParser< Arc >::FstArray ( ) const
inlineprotected

Definition at line 163 of file replace.h.

template<class Arc>
LabelStatePair fst::PdtParser< Arc >::GetLabelStatePair ( StateId  os) const
inlineprotected

Definition at line 176 of file replace.h.

template<class Arc>
virtual void fst::PdtParser< Arc >::GetParser ( MutableFst< Arc > *  ofst,
std::vector< LabelPair > *  parens 
)
pure virtual
template<class Arc>
StateId fst::PdtParser< Arc >::GetState ( const LabelStatePair lsp) const
inlineprotected

Definition at line 187 of file replace.h.

template<class Arc>
StateId fst::PdtParser< Arc >::Label2Id ( Label  l) const
inlineprotected

Definition at line 169 of file replace.h.

template<class Arc>
Label fst::PdtParser< Arc >::Root ( ) const
inlineprotected

Definition at line 165 of file replace.h.


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