#include <Parameter.h>
Public Member Functions | |
| Parameter () | |
| ~Parameter () | |
| bool | LoadParam (int argc, char *argv[]) |
| bool | LoadParam (const std::string &filePath) |
| void | Explain () |
| const PARAM_VEC & | GetParam (const std::string ¶mName) |
| bool | isParamSpecified (const std::string ¶mName) |
Protected Member Functions | |
| std::string | FindParam (const std::string ¶mSwitch, int argc, char *argv[]) |
| void | OverwriteParam (const std::string ¶mSwitch, const std::string ¶mName, int argc, char *argv[]) |
| bool | ReadConfigFile (const std::string &filePath) |
| bool | FilesExist (const std::string ¶mName, int fieldNo, std::vector< std::string > const &fileExtension=std::vector< std::string >(1,"")) |
| bool | isOption (const char *token) |
| bool | Validate () |
| void | AddParam (const std::string ¶mName, const std::string &description) |
| void | AddParam (const std::string ¶mName, const std::string &abbrevName, const std::string &description) |
| void | PrintCredit () |
Protected Attributes | |
| PARAM_MAP | m_setting |
| PARAM_BOOL | m_valid |
| PARAM_STRING | m_abbreviation |
| PARAM_STRING | m_description |
Definition at line 41 of file Parameter.h.
| Moses::Parameter::Parameter | ( | ) |
define allowed parameters
Definition at line 38 of file Parameter.cpp.
References AddParam().

| Moses::Parameter::~Parameter | ( | ) |
Definition at line 151 of file Parameter.cpp.
| void Moses::Parameter::AddParam | ( | const std::string & | paramName, | |
| const std::string & | abbrevName, | |||
| const std::string & | description | |||
| ) | [protected] |
| void Moses::Parameter::AddParam | ( | const std::string & | paramName, | |
| const std::string & | description | |||
| ) | [protected] |
| void Moses::Parameter::Explain | ( | ) |
print descriptions of all parameters
Definition at line 172 of file Parameter.cpp.
References m_abbreviation, and m_description.
Referenced by LoadParam(), and main().

| bool Moses::Parameter::FilesExist | ( | const std::string & | paramName, | |
| int | fieldNo, | |||
| std::vector< std::string > const & | fileExtension = std::vector< std::string >(1,"") | |||
| ) | [protected] |
| std::string Moses::Parameter::FindParam | ( | const std::string & | paramSwitch, | |
| int | argc, | |||
| char * | argv[] | |||
| ) | [protected] |
| const PARAM_VEC& Moses::Parameter::GetParam | ( | const std::string & | paramName | ) | [inline] |
return a vector of strings holding the whitespace-delimited values on the ini-file line corresponding to the given parameter name
Definition at line 69 of file Parameter.h.
References m_setting.
Referenced by Moses::StaticData::GetDescription(), Moses::StaticData::GetParam(), Moses::StaticData::LoadChartDecodingParameters(), Moses::StaticData::LoadData(), Moses::StaticData::LoadDecodeGraphs(), Moses::StaticData::LoadGenerationTables(), Moses::StaticData::LoadGlobalLexicalModel(), Moses::StaticData::LoadLanguageModels(), Moses::StaticData::LoadLexicalReorderingModel(), Moses::StaticData::LoadNonTerminals(), Moses::StaticData::LoadPhraseBasedParameters(), and Moses::StaticData::LoadPhraseTables().

| bool Moses::Parameter::isOption | ( | const char * | token | ) | [protected] |
check whether an item on the command line is a switch or a value
| token | token on the command line to checked |
Definition at line 189 of file Parameter.cpp.
Referenced by LoadParam().

| bool Moses::Parameter::isParamSpecified | ( | const std::string & | paramName | ) | [inline] |
check if parameter is defined (either in moses.ini or as switch)
Definition at line 73 of file Parameter.h.
References m_setting.
Referenced by Moses::StaticData::LoadData(), and main().

| bool Moses::Parameter::LoadParam | ( | const std::string & | filePath | ) |
| bool Moses::Parameter::LoadParam | ( | int | argc, | |
| char * | argv[] | |||
| ) |
load all parameters from the configuration file and the command line switches
Definition at line 207 of file Parameter.cpp.
References Moses::UserMessage::Add(), Explain(), FindParam(), isOption(), m_abbreviation, m_description, m_setting, m_valid, OverwriteParam(), PrintCredit(), ReadConfigFile(), TRACE_ERR, and Validate().
Referenced by main().


| void Moses::Parameter::OverwriteParam | ( | const std::string & | paramSwitch, | |
| const std::string & | paramName, | |||
| int | argc, | |||
| char * | argv[] | |||
| ) | [protected] |
| void Moses::Parameter::PrintCredit | ( | ) | [protected] |
Definition at line 513 of file Parameter.cpp.
References NULL.
Referenced by LoadParam().

| bool Moses::Parameter::ReadConfigFile | ( | const std::string & | filePath | ) | [protected] |
| bool Moses::Parameter::Validate | ( | ) | [protected] |
check that parameter settings make sense
Definition at line 271 of file Parameter.cpp.
References Moses::UserMessage::Add(), Moses::FileExists(), FilesExist(), key, m_setting, and m_valid.
Referenced by LoadParam().


PARAM_STRING Moses::Parameter::m_abbreviation [protected] |
PARAM_STRING Moses::Parameter::m_description [protected] |
PARAM_MAP Moses::Parameter::m_setting [protected] |
Definition at line 44 of file Parameter.h.
Referenced by GetParam(), isParamSpecified(), LoadParam(), and Validate().
PARAM_BOOL Moses::Parameter::m_valid [protected] |
1.5.9