Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/moses
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2016-08-18 00:44:04 +0300
committerKenneth Heafield <github@kheafield.com>2016-08-18 00:44:04 +0300
commitf260e432f55da5b1bed2c0b7036a1c43bed7bd72 (patch)
tree55781fa20b090b40494faf14db18a83c95d2aa6a /moses
parent49165a370b58f2ac1f9f18664be10edd28251259 (diff)
Make lazyken accept false
Diffstat (limited to 'moses')
-rw-r--r--moses/LM/Ken.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/moses/LM/Ken.cpp b/moses/LM/Ken.cpp
index a27940e72..8de121f2f 100644
--- a/moses/LM/Ken.cpp
+++ b/moses/LM/Ken.cpp
@@ -444,7 +444,13 @@ LanguageModel *ConstructKenLM(const std::string &lineOrig)
filePath.assign(value.data(), value.size());
} else if (name == "lazyken") {
// deprecated: use load instead.
- load_method = boost::lexical_cast<bool>(value) ? util::LAZY : util::POPULATE_OR_READ;
+ if (value == "0" || value == "false") {
+ load_method = util::POPULATE_OR_READ;
+ } else if (value == "1" || value == "true") {
+ load_method = util::LAZY;
+ } else {
+ UTIL_THROW2("Can't parse lazyken argument " << value << ". Also, lazyken is deprecated. Use load with one of the arguments lazy, populate_or_lazy, populate_or_read, read, or parallel_read.");
+ }
} else if (name == "load") {
if (value == "lazy") {
load_method = util::LAZY;