implement SetParameter for load_method

This commit is contained in:
Hieu Hoang 2017-02-16 11:33:24 +00:00
parent a391b84b42
commit 023a946a5b
2 changed files with 24 additions and 0 deletions

View File

@ -118,6 +118,28 @@ void ProbingPT::CreateAlignmentMap(const std::string path)
}
}
void ProbingPT::SetParameter(const std::string& key, const std::string& value)
{
if (key == "load") {
if (value == "lazy") {
load_method = util::LAZY;
} else if (value == "populate_or_lazy") {
load_method = util::POPULATE_OR_LAZY;
} else if (value == "populate_or_read" || value == "populate") {
load_method = util::POPULATE_OR_READ;
} else if (value == "read") {
load_method = util::READ;
} else if (value == "parallel_read") {
load_method = util::PARALLEL_READ;
} else {
UTIL_THROW2("load method not supported" << value);
}
} else {
PhraseDictionary::SetParameter(key, value);
}
}
void ProbingPT::InitializeForInput(ttasksptr const& ttask)
{

View File

@ -30,6 +30,8 @@ public:
void InitializeForInput(ttasksptr const& ttask);
void SetParameter(const std::string& key, const std::string& value);
// for phrase-based model
void GetTargetPhraseCollectionBatch(const InputPathList &inputPathQueue) const;