diff options
author | Kenneth Heafield <github@kheafield.com> | 2016-08-18 00:44:04 +0300 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2016-08-18 00:44:04 +0300 |
commit | f260e432f55da5b1bed2c0b7036a1c43bed7bd72 (patch) | |
tree | 55781fa20b090b40494faf14db18a83c95d2aa6a /moses | |
parent | 49165a370b58f2ac1f9f18664be10edd28251259 (diff) |
Make lazyken accept false
Diffstat (limited to 'moses')
-rw-r--r-- | moses/LM/Ken.cpp | 8 |
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; |