diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2013-11-19 21:23:19 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2013-11-19 21:23:19 +0400 |
commit | 22864c2b4b154b2c69518bf773fe73f4c557af0a (patch) | |
tree | 660ee9759c095d2c38b769db69259b38d096fc37 /moses/PCNTools.cpp | |
parent | c2c86ce50d1900db55e420dd08f38facfce50501 (diff) |
replace CHECK with UTIL_THROW_IF in Moses
Diffstat (limited to 'moses/PCNTools.cpp')
-rw-r--r-- | moses/PCNTools.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/moses/PCNTools.cpp b/moses/PCNTools.cpp index 1ed1aa4cd..fd05907d6 100644 --- a/moses/PCNTools.cpp +++ b/moses/PCNTools.cpp @@ -3,6 +3,7 @@ #include <iostream> #include <cstdlib> #include "Util.h" +#include "util/exception.hh" using namespace std; @@ -127,7 +128,7 @@ CNAlt getCNAlt(const std::string& in, int &c) for (; ind < toks.size() - 1; ++ind) { const string &tok = toks[ind]; vector<string> keyValue = Moses::Tokenize(tok, "="); - CHECK(keyValue.size() == 2); + UTIL_THROW_IF(keyValue.size() != 2, util::Exception, "Format error: " << tok); float prob = Moses::Scan<float>(keyValue[1]); sparseFeatures[ keyValue[0] ] = prob; } |