Cambridge SMT System
ucam::hifst::ReferenceFilterTask< Data, Arc > Class Template Reference

Generates a substring version of a reference translation lattice and associated vocabulary. This substring fst is typically used to guide translation towards a particular search space. The associated vocabulary can be used e.g. to restrict parsing algorithms. More...

#include <task.referencefilter.hpp>

Inheritance diagram for ucam::hifst::ReferenceFilterTask< Data, Arc >:
Collaboration diagram for ucam::hifst::ReferenceFilterTask< Data, Arc >:

Public Member Functions

 ReferenceFilterTask (const ucam::util::RegistryPO &rg, const std::string &referencelatticekey=HifstConstants::kReferencefilterNosubstringStore)
 Constructor. More...
 
bool getDisableSubString (void)
 
bool getBuilt (void)
 
float getWeight (void)
 
unsigned getShortestPath (void)
 
const unordered_set< std::string > & getVocabulary ()
 
const std::string getTranslationLatticeFile ()
 
 ~ReferenceFilterTask ()
 Destructor. More...
 
void prune ()
 Filters the reference lattice using either shortestpath, weighted determinization or both (union). More...
 
void reduce ()
 Removes weights and reduces the reference lattice with determinization and minimization. More...
 
void build (const std::string &file)
 Given an fst file, builds the unweighted substring transducer. More...
 
void unload (void)
 Clean up fsts... More...
 
void write (Data &d)
 Write reference substring lattice to [file]. More...
 
bool run (Data &d)
 Runs... Load substring lattice and add pointer in data object. More...
 
- Public Member Functions inherited from ucam::util::TaskInterface< Data >
 TaskInterface ()
 Constructor. More...
 
virtual ~TaskInterface ()
 
bool chainrun (Data &d)
 Implements chain of responsability. Calls run method and, if there is another task, call its run method too. More...
 
bool operator() (Data &d)
 
TaskInterfaceappendTask (TaskInterface *t)
 Appends a task class. If there is no task, append here, otherwise delegate in next task. More...
 
TaskInterfaceoperator() (TaskInterface *t)
 
TaskInterfacegetTask ()
 Return appended task. More...
 
TaskInterfacenext ()
 

Static Public Member Functions

static ReferenceFilterTaskinit (const ucam::util::RegistryPO &rg, const std::string &referenceloadkey=HifstConstants::kReferencefilterLoad, const std::string &referencelatticekey=HifstConstants::kReferencefilterNosubstringStore)
 Static constructor, returns NULL if the substring lattice is not needed (e.g. hifst not in alignment mode) More...
 

Detailed Description

template<class Data, class Arc = fst::LexStdArc>
class ucam::hifst::ReferenceFilterTask< Data, Arc >

Generates a substring version of a reference translation lattice and associated vocabulary. This substring fst is typically used to guide translation towards a particular search space. The associated vocabulary can be used e.g. to restrict parsing algorithms.

Definition at line 33 of file task.referencefilter.hpp.

Constructor & Destructor Documentation

template<class Data, class Arc = fst::LexStdArc>
ucam::hifst::ReferenceFilterTask< Data, Arc >::ReferenceFilterTask ( const ucam::util::RegistryPO rg,
const std::string &  referencelatticekey = HifstConstants::kReferencefilterNosubstringStore 
)
inline

Constructor.

Parameters
rgRegistryPO object containing parsed command-line/config-file variables.
referencelatticekeykey to access the reference lattice file name in registry object (for storing)

Definition at line 81 of file task.referencefilter.hpp.

template<class Data, class Arc = fst::LexStdArc>
ucam::hifst::ReferenceFilterTask< Data, Arc >::~ReferenceFilterTask ( )
inline

Destructor.

Definition at line 130 of file task.referencefilter.hpp.

Here is the call graph for this function:

Member Function Documentation

template<class Data, class Arc = fst::LexStdArc>
void ucam::hifst::ReferenceFilterTask< Data, Arc >::build ( const std::string &  file)
inline

Given an fst file, builds the unweighted substring transducer.

Remarks
The lattice can be previously shortestpath-ed or pruned. It will be determinized too
Parameters
fileLattice file name (openfst file expected).

Definition at line 192 of file task.referencefilter.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Data, class Arc = fst::LexStdArc>
bool ucam::hifst::ReferenceFilterTask< Data, Arc >::getBuilt ( void  )
inline

Definition at line 113 of file task.referencefilter.hpp.

Here is the caller graph for this function:

template<class Data, class Arc = fst::LexStdArc>
bool ucam::hifst::ReferenceFilterTask< Data, Arc >::getDisableSubString ( void  )
inline

Definition at line 110 of file task.referencefilter.hpp.

Here is the caller graph for this function:

template<class Data, class Arc = fst::LexStdArc>
unsigned ucam::hifst::ReferenceFilterTask< Data, Arc >::getShortestPath ( void  )
inline

Definition at line 119 of file task.referencefilter.hpp.

Here is the caller graph for this function:

template<class Data, class Arc = fst::LexStdArc>
const std::string ucam::hifst::ReferenceFilterTask< Data, Arc >::getTranslationLatticeFile ( )
inline

Definition at line 125 of file task.referencefilter.hpp.

Here is the caller graph for this function:

template<class Data, class Arc = fst::LexStdArc>
const unordered_set<std::string>& ucam::hifst::ReferenceFilterTask< Data, Arc >::getVocabulary ( )
inline

Definition at line 122 of file task.referencefilter.hpp.

Here is the caller graph for this function:

template<class Data, class Arc = fst::LexStdArc>
float ucam::hifst::ReferenceFilterTask< Data, Arc >::getWeight ( void  )
inline

Definition at line 116 of file task.referencefilter.hpp.

Here is the caller graph for this function:

template<class Data, class Arc = fst::LexStdArc>
static ReferenceFilterTask* ucam::hifst::ReferenceFilterTask< Data, Arc >::init ( const ucam::util::RegistryPO rg,
const std::string &  referenceloadkey = HifstConstants::kReferencefilterLoad,
const std::string &  referencelatticekey = HifstConstants::kReferencefilterNosubstringStore 
)
inlinestatic

Static constructor, returns NULL if the substring lattice is not needed (e.g. hifst not in alignment mode)

Definition at line 135 of file task.referencefilter.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Data, class Arc = fst::LexStdArc>
void ucam::hifst::ReferenceFilterTask< Data, Arc >::prune ( )
inline

Filters the reference lattice using either shortestpath, weighted determinization or both (union).

Definition at line 149 of file task.referencefilter.hpp.

Here is the caller graph for this function:

template<class Data, class Arc = fst::LexStdArc>
void ucam::hifst::ReferenceFilterTask< Data, Arc >::reduce ( )
inline

Removes weights and reduces the reference lattice with determinization and minimization.

Definition at line 179 of file task.referencefilter.hpp.

Here is the caller graph for this function:

template<class Data, class Arc = fst::LexStdArc>
bool ucam::hifst::ReferenceFilterTask< Data, Arc >::run ( Data &  d)
inlinevirtual

Runs... Load substring lattice and add pointer in data object.

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

Definition at line 233 of file task.referencefilter.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Data, class Arc = fst::LexStdArc>
void ucam::hifst::ReferenceFilterTask< Data, Arc >::unload ( void  )
inline

Clean up fsts...

Definition at line 217 of file task.referencefilter.hpp.

Here is the caller graph for this function:

template<class Data, class Arc = fst::LexStdArc>
void ucam::hifst::ReferenceFilterTask< Data, Arc >::write ( Data &  d)
inline

Write reference substring lattice to [file].

Definition at line 226 of file task.referencefilter.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:


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