diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2017-02-16 14:33:24 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2017-02-16 14:33:24 +0300 |
commit | 023a946a5be0c0259e884380725a7cf86af3e313 (patch) | |
tree | 4309515274e75594bd4e52408cb5c1ac16d5360e /moses | |
parent | a391b84b4275d90cabd2bf9d1734ac2c10c9e8bd (diff) |
implement SetParameter for load_method
Diffstat (limited to 'moses')
-rw-r--r-- | moses/TranslationModel/ProbingPT.cpp | 22 | ||||
-rw-r--r-- | moses/TranslationModel/ProbingPT.h | 2 |
2 files changed, 24 insertions, 0 deletions
diff --git a/moses/TranslationModel/ProbingPT.cpp b/moses/TranslationModel/ProbingPT.cpp index 2a7369622..9a8d4c700 100644 --- a/moses/TranslationModel/ProbingPT.cpp +++ b/moses/TranslationModel/ProbingPT.cpp @@ -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) { diff --git a/moses/TranslationModel/ProbingPT.h b/moses/TranslationModel/ProbingPT.h index bdf5a3bda..1c996f5fa 100644 --- a/moses/TranslationModel/ProbingPT.h +++ b/moses/TranslationModel/ProbingPT.h @@ -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; |