Cambridge SMT System
|
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>
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) |
TaskInterface & | appendTask (TaskInterface *t) |
Appends a task class. If there is no task, append here, otherwise delegate in next task. More... | |
TaskInterface & | operator() (TaskInterface *t) |
TaskInterface * | getTask () |
Return appended task. More... | |
TaskInterface * | next () |
Static Public Member Functions | |
static ReferenceFilterTask * | init (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... | |
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.
|
inline |
Constructor.
rg | RegistryPO object containing parsed command-line/config-file variables. |
referencelatticekey | key to access the reference lattice file name in registry object (for storing) |
Definition at line 81 of file task.referencefilter.hpp.
|
inline |
Destructor.
Definition at line 130 of file task.referencefilter.hpp.
|
inline |
Given an fst file, builds the unweighted substring transducer.
file | Lattice file name (openfst file expected). |
Definition at line 192 of file task.referencefilter.hpp.
|
inline |
Definition at line 113 of file task.referencefilter.hpp.
|
inline |
Definition at line 110 of file task.referencefilter.hpp.
|
inline |
Definition at line 119 of file task.referencefilter.hpp.
|
inline |
Definition at line 125 of file task.referencefilter.hpp.
|
inline |
Definition at line 122 of file task.referencefilter.hpp.
|
inline |
Definition at line 116 of file task.referencefilter.hpp.
|
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.
|
inline |
Filters the reference lattice using either shortestpath, weighted determinization or both (union).
Definition at line 149 of file task.referencefilter.hpp.
|
inline |
Removes weights and reduces the reference lattice with determinization and minimization.
Definition at line 179 of file task.referencefilter.hpp.
|
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.
|
inline |
Clean up fsts...
Definition at line 217 of file task.referencefilter.hpp.
|
inline |
Write reference substring lattice to [file].
Definition at line 226 of file task.referencefilter.hpp.