Cambridge SMT System
ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT > Class Template Reference

Implements a class that loads the grammar sparseweight flower lattice and stores a pointer on the data object. More...

#include <task.loadsparseweightflowerfst.hpp>

Inheritance diagram for ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >:
Collaboration diagram for ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >:

Public Member Functions

 LoadSparseWeightFlowerLatticeTask (const ucam::util::RegistryPO &rg, const unsigned offset=1, const std::string &alignmentlattices="", const std::string &grammarloadkey=HifstConstants::kRuleflowerlatticeLoad, const std::string &grammarstorekey=HifstConstants::kRuleflowerlatticeStore)
 Constructor with registry object, offset and keys. More...
 
bool run (DataT &d)
 Inherited method from ucam::util::TaskInterface. Loads the flower lattice into the data object. More...
 
bool directload (const std::string &filename)
 If it is an fst, load directly. More...
 
bool checkGrammarFile (std::string const &filename)
 
void updateFilename (std::string const &filename)
 
virtual void gatherRuleIds (unordered_set< unsigned > &idxrules, bool filterbyalilats, ucam::util::IntegerPatternAddress &alilats, ucam::util::RegistryPO const &rg)
 
virtual void initStructure ()
 
virtual void fillStructure (unsigned label, TupleArc32::Weight const &vtcost)
 
virtual void closeStructure ()
 
bool load (const std::string &filename)
 Load flower lattice from file. More...
 
- Public Member Functions inherited from ucam::util::TaskInterface< DataT >
 TaskInterface ()
 Constructor. More...
 
virtual ~TaskInterface ()
 
bool chainrun (DataT &d)
 Implements chain of responsability. Calls run method and, if there is another task, call its run method too. More...
 
bool operator() (DataT &d)
 
TaskInterfaceoperator() (TaskInterface *t)
 
TaskInterfaceappendTask (TaskInterface *t)
 Appends a task class. If there is no task, append here, otherwise delegate in next task. More...
 
TaskInterfacegetTask ()
 Return appended task. More...
 
TaskInterfacenext ()
 

Protected Attributes

fst::VectorFst< TupleArc32flowerlattice_
 Fst with the flower lattice itself. More...
 
std::vector< float > & fscales_
 sparse tuple-weight scales More...
 
ucam::util::IntegerPatternAddress alilats_
 Alignment lattices file names. More...
 
ucam::util::IntegerPatternAddress grammar_
 Grammar file name. More...
 
std::string previousfile_
 Previous grammar file name. More...
 
bool filterbyalilats_
 If true, the grammar flower lattice will be loaded only with rules that have been used in the alignment lattices. More...
 
const ucam::util::RegistryPOrg_
 Registry object – contains program options. More...
 
bool built_
 Is the flower lattice built. More...
 
const std::string grammarloadkey_
 Key with access to registry object for the grammar file name. More...
 
const std::string grammarstorekey_
 Key to store in the data object. More...
 
const unsigned offset_
 Number of language models. More...
 

Detailed Description

template<class DataT>
class ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >

Implements a class that loads the grammar sparseweight flower lattice and stores a pointer on the data object.

Definition at line 31 of file task.loadsparseweightflowerfst.hpp.

Constructor & Destructor Documentation

template<class DataT >
ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::LoadSparseWeightFlowerLatticeTask ( const ucam::util::RegistryPO rg,
const unsigned  offset = 1,
const std::string &  alignmentlattices = "",
const std::string &  grammarloadkey = HifstConstants::kRuleflowerlatticeLoad,
const std::string &  grammarstorekey = HifstConstants::kRuleflowerlatticeStore 
)
inline

Constructor with registry object, offset and keys.

Definition at line 68 of file task.loadsparseweightflowerfst.hpp.

Member Function Documentation

template<class DataT >
bool ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::checkGrammarFile ( std::string const &  filename)
inline

Definition at line 111 of file task.loadsparseweightflowerfst.hpp.

Here is the caller graph for this function:

template<class DataT >
virtual void ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::closeStructure ( )
inlinevirtual

Reimplemented in ucam::hifst::LoadSparseWeightsTask< DataT >.

Definition at line 152 of file task.loadsparseweightflowerfst.hpp.

Here is the caller graph for this function:

template<class DataT >
bool ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::directload ( const std::string &  filename)
inline

If it is an fst, load directly.

Definition at line 93 of file task.loadsparseweightflowerfst.hpp.

Here is the caller graph for this function:

template<class DataT >
virtual void ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::fillStructure ( unsigned  label,
TupleArc32::Weight const &  vtcost 
)
inlinevirtual

Reimplemented in ucam::hifst::LoadSparseWeightsTask< DataT >.

Definition at line 148 of file task.loadsparseweightflowerfst.hpp.

Here is the caller graph for this function:

template<class DataT >
virtual void ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::gatherRuleIds ( unordered_set< unsigned > &  idxrules,
bool  filterbyalilats,
ucam::util::IntegerPatternAddress alilats,
ucam::util::RegistryPO const &  rg 
)
inlinevirtual

Reimplemented in ucam::hifst::LoadSparseWeightsTask< DataT >.

Definition at line 124 of file task.loadsparseweightflowerfst.hpp.

Here is the caller graph for this function:

template<class DataT >
virtual void ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::initStructure ( )
inlinevirtual

Reimplemented in ucam::hifst::LoadSparseWeightsTask< DataT >.

Definition at line 142 of file task.loadsparseweightflowerfst.hpp.

Here is the caller graph for this function:

template<class DataT >
bool ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::load ( const std::string &  filename)
inline

Load flower lattice from file.

Remarks
Each rule will be a single arc in the fst with the rule index Tropical Sparse Tuple weight is used. Each arc (rule) has a set of feature weights. The first weight is at offset_+1. Weight indices 1..offset_ are left empty for the language model(s) to fill in.

Definition at line 162 of file task.loadsparseweightflowerfst.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class DataT >
bool ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::run ( DataT &  d)
inlinevirtual

Inherited method from ucam::util::TaskInterface. Loads the flower lattice into the data object.

Implements ucam::util::TaskInterface< DataT >.

Reimplemented in ucam::hifst::LoadSparseWeightsTask< DataT >.

Definition at line 86 of file task.loadsparseweightflowerfst.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class DataT >
void ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::updateFilename ( std::string const &  filename)
inline

Definition at line 120 of file task.loadsparseweightflowerfst.hpp.

Here is the caller graph for this function:

Member Data Documentation

template<class DataT >
ucam::util::IntegerPatternAddress ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::alilats_
protected

Alignment lattices file names.

Definition at line 42 of file task.loadsparseweightflowerfst.hpp.

template<class DataT >
bool ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::built_
protected

Is the flower lattice built.

Definition at line 57 of file task.loadsparseweightflowerfst.hpp.

template<class DataT >
bool ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::filterbyalilats_
protected

If true, the grammar flower lattice will be loaded only with rules that have been used in the alignment lattices.

Definition at line 51 of file task.loadsparseweightflowerfst.hpp.

template<class DataT >
fst::VectorFst<TupleArc32> ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::flowerlattice_
protected

Fst with the flower lattice itself.

Definition at line 36 of file task.loadsparseweightflowerfst.hpp.

template<class DataT >
std::vector<float>& ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::fscales_
protected

sparse tuple-weight scales

Definition at line 39 of file task.loadsparseweightflowerfst.hpp.

template<class DataT >
ucam::util::IntegerPatternAddress ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::grammar_
protected

Grammar file name.

Definition at line 45 of file task.loadsparseweightflowerfst.hpp.

template<class DataT >
const std::string ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::grammarloadkey_
protected

Key with access to registry object for the grammar file name.

Definition at line 60 of file task.loadsparseweightflowerfst.hpp.

template<class DataT >
const std::string ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::grammarstorekey_
protected

Key to store in the data object.

Definition at line 62 of file task.loadsparseweightflowerfst.hpp.

template<class DataT >
const unsigned ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::offset_
protected

Number of language models.

Definition at line 65 of file task.loadsparseweightflowerfst.hpp.

template<class DataT >
std::string ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::previousfile_
protected

Previous grammar file name.

Definition at line 48 of file task.loadsparseweightflowerfst.hpp.

template<class DataT >
const ucam::util::RegistryPO& ucam::hifst::LoadSparseWeightFlowerLatticeTask< DataT >::rg_
protected

Registry object – contains program options.

Definition at line 54 of file task.loadsparseweightflowerfst.hpp.


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