mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 19:27:11 +03:00
implement SetParameter for load_method
This commit is contained in:
parent
a391b84b42
commit
023a946a5b
@ -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)
|
void ProbingPT::InitializeForInput(ttasksptr const& ttask)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -30,6 +30,8 @@ public:
|
|||||||
|
|
||||||
void InitializeForInput(ttasksptr const& ttask);
|
void InitializeForInput(ttasksptr const& ttask);
|
||||||
|
|
||||||
|
void SetParameter(const std::string& key, const std::string& value);
|
||||||
|
|
||||||
// for phrase-based model
|
// for phrase-based model
|
||||||
void GetTargetPhraseCollectionBatch(const InputPathList &inputPathQueue) const;
|
void GetTargetPhraseCollectionBatch(const InputPathList &inputPathQueue) const;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user