#include <lmContainer.h>
Public Member Functions | |
lmContainer () | |
virtual | ~lmContainer () |
virtual void | load (const std::string filename, int mmap=0) |
virtual void | savetxt (const char *filename) |
virtual void | savebin (const char *filename) |
virtual double | getlogOOVpenalty () const |
virtual double | setlogOOVpenalty (int dub) |
virtual double | setlogOOVpenalty (double oovp) |
virtual dictionary * | getDict () const |
virtual void | maxlevel (int lev) |
virtual int | maxlevel () const |
virtual void | stat (int lev=0) |
virtual void | setMaxLoadedLevel (int lev) |
virtual int | getMaxLoadedLevel () |
virtual bool | is_inverted (const bool flag) |
virtual bool | is_inverted () |
virtual double | clprob (ngram ng, double *bow=NULL, int *bol=NULL, char **maxsuffptr=NULL, unsigned int *statesize=NULL, bool *extendible=NULL) |
virtual double | clprob (int *ng, int ngsize, double *bow=NULL, int *bol=NULL, char **maxsuffptr=NULL, unsigned int *statesize=NULL, bool *extendible=NULL) |
virtual void | used_caches () |
virtual void | init_caches (int uptolev) |
virtual void | check_caches_levels () |
virtual void | reset_caches () |
virtual void | reset_mmap () |
void | setLanguageModelType (int type) |
int | getLanguageModelType () |
int | getLanguageModelType (std::string filename) |
virtual void | dictionary_incflag (const bool flag) |
virtual bool | filter (const string sfilter, lmContainer *&sublmt, const string skeepunigrams) |
lmContainer * | CreateLanguageModel (const std::string infile, float nlf=0.0, float dlf=0.0) |
lmContainer * | CreateLanguageModel (int type, float nlf=0.0, float dlf=0.0) |
virtual bool | is_OOV (int code) |
bool | is_lmt_cache_enabled () |
bool | is_ps_cache_enabled () |
bool | is_cache_enabled () |
Protected Attributes | |
int | lmtype |
int | maxlev |
int | requiredMaxlev |
Definition at line 42 of file lmContainer.h.
lmContainer::lmContainer | ( | ) |
virtual lmContainer::~lmContainer | ( | ) | [inline, virtual] |
Definition at line 54 of file lmContainer.h.
virtual void lmContainer::check_caches_levels | ( | ) | [inline, virtual] |
Reimplemented in lmtable.
Definition at line 131 of file lmContainer.h.
Referenced by main().
virtual double lmContainer::clprob | ( | int * | ng, | |
int | ngsize, | |||
double * | bow = NULL , |
|||
int * | bol = NULL , |
|||
char ** | maxsuffptr = NULL , |
|||
unsigned int * | statesize = NULL , |
|||
bool * | extendible = NULL | |||
) | [inline, virtual] |
Reimplemented in lmclass, lmInterpolation, lmmacro, and lmtable.
Definition at line 116 of file lmContainer.h.
References UNUSED.
virtual double lmContainer::clprob | ( | ngram | ng, | |
double * | bow = NULL , |
|||
int * | bol = NULL , |
|||
char ** | maxsuffptr = NULL , |
|||
unsigned int * | statesize = NULL , |
|||
bool * | extendible = NULL | |||
) | [inline, virtual] |
Reimplemented in lmclass, lmInterpolation, lmmacro, and lmtable.
Definition at line 107 of file lmContainer.h.
References UNUSED.
Referenced by Moses::LanguageModelIRST::CalcScore(), Moses::LanguageModelIRST::EvaluateWhenApplied(), and main().
lmContainer * lmContainer::CreateLanguageModel | ( | int | type, | |
float | nlf = 0.0 , |
|||
float | dlf = 0.0 | |||
) |
Definition at line 87 of file lmContainer.cpp.
References _IRSTLM_LMCLASS, _IRSTLM_LMINTERPOLATION, _IRSTLM_LMMACRO, _IRSTLM_LMTABLE, NULL, and setLanguageModelType().
lmContainer * lmContainer::CreateLanguageModel | ( | const std::string | infile, | |
float | nlf = 0.0 , |
|||
float | dlf = 0.0 | |||
) |
Definition at line 79 of file lmContainer.cpp.
References getLanguageModelType().
Referenced by filter(), Moses::LanguageModelIRST::Load(), lmInterpolation::load_lm(), load_lm(), and main().
virtual void lmContainer::dictionary_incflag | ( | const bool | flag | ) | [inline, virtual] |
Reimplemented in lmclass, lmInterpolation, lmmacro, and lmtable.
Definition at line 144 of file lmContainer.h.
References UNUSED.
Referenced by main().
bool lmContainer::filter | ( | const string | sfilter, | |
lmContainer *& | sublmt, | |||
const string | skeepunigrams | |||
) | [virtual] |
Definition at line 123 of file lmContainer.cpp.
References _IRSTLM_LMTABLE, CreateLanguageModel(), getMaxLoadedLevel(), is_inverted(), lmtype, maxlevel(), and setMaxLoadedLevel().
virtual dictionary* lmContainer::getDict | ( | ) | const [inline, virtual] |
Reimplemented in lmclass, lmInterpolation, lmmacro, and lmtable.
Definition at line 80 of file lmContainer.h.
References NULL.
Referenced by Moses::LanguageModelIRST::Load(), and main().
int lmContainer::getLanguageModelType | ( | std::string | filename | ) |
Definition at line 48 of file lmContainer.cpp.
References _IRSTLM_LMCLASS, _IRSTLM_LMINTERPOLATION, _IRSTLM_LMMACRO, _IRSTLM_LMTABLE, _IRSTLM_LMUNKNOWN, and VERBOSE.
int lmContainer::getLanguageModelType | ( | ) | [inline] |
Definition at line 139 of file lmContainer.h.
References lmtype.
Referenced by CreateLanguageModel(), and main().
virtual double lmContainer::getlogOOVpenalty | ( | ) | const [inline, virtual] |
Reimplemented in lmInterpolation, and lmtable.
Definition at line 68 of file lmContainer.h.
Referenced by main().
virtual int lmContainer::getMaxLoadedLevel | ( | ) | [inline, virtual] |
Definition at line 96 of file lmContainer.h.
References requiredMaxlev.
Referenced by filter().
virtual void lmContainer::init_caches | ( | int | uptolev | ) | [inline, virtual] |
Reimplemented in lmtable.
Definition at line 128 of file lmContainer.h.
References UNUSED.
Referenced by Moses::LanguageModelIRST::Load(), lmInterpolation::load_lm(), load_lm(), and main().
bool lmContainer::is_cache_enabled | ( | ) | [inline] |
Definition at line 173 of file lmContainer.h.
References is_lmt_cache_enabled(), and is_ps_cache_enabled().
Referenced by main().
virtual bool lmContainer::is_inverted | ( | ) | [inline, virtual] |
Reimplemented in lmInterpolation, and lmtable.
Definition at line 104 of file lmContainer.h.
Referenced by filter().
virtual bool lmContainer::is_inverted | ( | const bool | flag | ) | [inline, virtual] |
Reimplemented in lmInterpolation, and lmtable.
Definition at line 100 of file lmContainer.h.
References UNUSED.
Referenced by filter(), lmInterpolation::load_lm(), and main().
bool lmContainer::is_lmt_cache_enabled | ( | ) | [inline] |
Definition at line 159 of file lmContainer.h.
Referenced by is_cache_enabled().
virtual bool lmContainer::is_OOV | ( | int | code | ) | [inline, virtual] |
Reimplemented in lmInterpolation, and lmtable.
Definition at line 153 of file lmContainer.h.
References UNUSED.
Referenced by main().
bool lmContainer::is_ps_cache_enabled | ( | ) | [inline] |
Definition at line 166 of file lmContainer.h.
Referenced by is_cache_enabled().
virtual void lmContainer::load | ( | const std::string | filename, | |
int | mmap = 0 | |||
) | [inline, virtual] |
Reimplemented in lmclass, lmInterpolation, lmmacro, and lmtable.
Definition at line 56 of file lmContainer.h.
References UNUSED.
Referenced by Moses::LanguageModelIRST::Load(), lmInterpolation::load_lm(), load_lm(), and main().
virtual int lmContainer::maxlevel | ( | ) | const [inline, virtual] |
Reimplemented in lmInterpolation, lmmacro, and lmtable.
Definition at line 86 of file lmContainer.h.
References maxlev.
Referenced by filter().
virtual void lmContainer::maxlevel | ( | int | lev | ) | [inline, virtual] |
Definition at line 83 of file lmContainer.h.
References maxlev.
Referenced by filter(), Moses::LanguageModelIRST::Load(), lmInterpolation::load_lm(), load_lm(), and main().
virtual void lmContainer::reset_caches | ( | ) | [inline, virtual] |
Reimplemented in lmtable.
Definition at line 132 of file lmContainer.h.
Referenced by Moses::LanguageModelIRST::CleanUpAfterSentenceProcessing().
virtual void lmContainer::reset_mmap | ( | ) | [inline, virtual] |
Reimplemented in lmtable.
Definition at line 134 of file lmContainer.h.
Referenced by Moses::LanguageModelIRST::~LanguageModelIRST().
virtual void lmContainer::savebin | ( | const char * | filename | ) | [inline, virtual] |
Reimplemented in lmtable.
Definition at line 64 of file lmContainer.h.
References UNUSED.
Referenced by main().
virtual void lmContainer::savetxt | ( | const char * | filename | ) | [inline, virtual] |
Reimplemented in lmtable.
Definition at line 61 of file lmContainer.h.
References UNUSED.
Referenced by main().
void lmContainer::setLanguageModelType | ( | int | type | ) | [inline] |
Definition at line 136 of file lmContainer.h.
References lmtype.
Referenced by CreateLanguageModel().
virtual double lmContainer::setlogOOVpenalty | ( | double | oovp | ) | [inline, virtual] |
Reimplemented in lmInterpolation, and lmtable.
Definition at line 75 of file lmContainer.h.
References UNUSED.
virtual double lmContainer::setlogOOVpenalty | ( | int | dub | ) | [inline, virtual] |
Reimplemented in lmInterpolation, and lmtable.
Definition at line 71 of file lmContainer.h.
References UNUSED.
Referenced by Moses::LanguageModelIRST::Load(), load_lm(), and main().
virtual void lmContainer::setMaxLoadedLevel | ( | int | lev | ) | [inline, virtual] |
Definition at line 93 of file lmContainer.h.
References requiredMaxlev.
Referenced by filter(), Moses::LanguageModelIRST::Load(), lmtable::load(), lmInterpolation::load_lm(), load_lm(), and main().
virtual void lmContainer::stat | ( | int | lev = 0 |
) | [inline, virtual] |
Reimplemented in lmtable.
Definition at line 89 of file lmContainer.h.
References UNUSED.
Referenced by main().
virtual void lmContainer::used_caches | ( | ) | [inline, virtual] |
Reimplemented in lmtable.
Definition at line 127 of file lmContainer.h.
Referenced by main().
int lmContainer::lmtype [protected] |
Definition at line 47 of file lmContainer.h.
Referenced by filter(), getLanguageModelType(), and setLanguageModelType().
int lmContainer::maxlev [protected] |
Definition at line 48 of file lmContainer.h.
Referenced by lmtable::add(), lmtable::addwithoffset(), lmtable::appendbin_level_nommap(), lmtable::configure(), lmtable::cpsublm(), lmtable::expand_level_mmap(), lmtable::expand_level_nommap(), lmtable::init_prob_and_state_cache(), lmclass::load(), lmtable::maxlevel(), maxlevel(), lmtable::print_table_stat(), lmtable::printTable(), lmtable::resize_level(), lmtable::savebin(), lmtable::savebin_level_nommap(), lmtable::savetxt(), and lmtable::~lmtable().
int lmContainer::requiredMaxlev [protected] |
Definition at line 49 of file lmContainer.h.
Referenced by getMaxLoadedLevel(), lmContainer(), lmtable::lmtable(), lmtable::load(), lmInterpolation::load_lm(), lmtable::savebin_level_nommap(), and setMaxLoadedLevel().