Cambridge SMT System
ucam::fsttools::LoadLanguageModelTask< Data > Class Template Reference

Language model loader task, loads a language model wrapping it in a class to provide. More...

#include <task.loadlm.hpp>

Inheritance diagram for ucam::fsttools::LoadLanguageModelTask< Data >:
Collaboration diagram for ucam::fsttools::LoadLanguageModelTask< Data >:

Public Member Functions

 LoadLanguageModelTask (const ucam::util::RegistryPO &rg, const std::string &lmload=HifstConstants::kLmLoad, const std::string &lmscale=HifstConstants::kLmFeatureweights, const std::string &lmwp=HifstConstants::kLmWordPenalty, const std::string &wordmapkey=HifstConstants::kLmWordmap, bool forceone=false)
 Public constructor. If the user wants to load several language models (e.g. –lm.load=lm1,lm2,lm3,lm4 and –lm.scale=0.25,0.25,0.25 ), the second and following instances of LoadLanguageModelTask will be created using the private constructor (see below), which has an index to the actual language model that must be loaded. For the public constructor, the index is set to 0. More...
 
bool run (Data &d)
 Method inherited from TaskInterface. Loads the language model and stores in lm data structure. More...
 
bool close ()
 Free language model resources. Returns true if ok, false if otherwise. More...
 
 ~LoadLanguageModelTask ()
 Destructor. 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 ()
 

Detailed Description

template<class Data>
class ucam::fsttools::LoadLanguageModelTask< Data >

Language model loader task, loads a language model wrapping it in a class to provide.

Definition at line 144 of file task.loadlm.hpp.

Constructor & Destructor Documentation

template<class Data>
ucam::fsttools::LoadLanguageModelTask< Data >::LoadLanguageModelTask ( const ucam::util::RegistryPO rg,
const std::string &  lmload = HifstConstants::kLmLoad,
const std::string &  lmscale = HifstConstants::kLmFeatureweights,
const std::string &  lmwp = HifstConstants::kLmWordPenalty,
const std::string &  wordmapkey = HifstConstants::kLmWordmap,
bool  forceone = false 
)
inline

Public constructor. If the user wants to load several language models (e.g. –lm.load=lm1,lm2,lm3,lm4 and –lm.scale=0.25,0.25,0.25 ), the second and following instances of LoadLanguageModelTask will be created using the private constructor (see below), which has an index to the actual language model that must be loaded. For the public constructor, the index is set to 0.

Parameters
rgucam::util::RegistryPO object, containing user parameters.
lmloadkey word to access the registry object for language models
lmscalekey word to access the registry object for language model scales.
forceoneTo force the loading of only one language model (i.e. lm1 with scale 0.25).

Definition at line 183 of file task.loadlm.hpp.

Here is the call graph for this function:

template<class Data>
ucam::fsttools::LoadLanguageModelTask< Data >::~LoadLanguageModelTask ( )
inline

Destructor.

Definition at line 274 of file task.loadlm.hpp.

Here is the call graph for this function:

Member Function Documentation

template<class Data>
bool ucam::fsttools::LoadLanguageModelTask< Data >::close ( )
inline

Free language model resources. Returns true if ok, false if otherwise.

Definition at line 262 of file task.loadlm.hpp.

template<class Data>
bool ucam::fsttools::LoadLanguageModelTask< Data >::run ( Data &  d)
inlinevirtual

Method inherited from TaskInterface. Loads the language model and stores in lm data structure.

Parameters
&ddata structure in which the null filter is to be stored.
Returns
false (does not break in any case the chain of tasks)

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

Definition at line 226 of file task.loadlm.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: