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/Word.cpp | |
parent | c2c86ce50d1900db55e420dd08f38facfce50501 (diff) |
replace CHECK with UTIL_THROW_IF in Moses
Diffstat (limited to 'moses/Word.cpp')
-rw-r--r-- | moses/Word.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/moses/Word.cpp b/moses/Word.cpp index 74f19b695..32c3d3163 100644 --- a/moses/Word.cpp +++ b/moses/Word.cpp @@ -71,10 +71,12 @@ void Word::Merge(const Word &sourceWord) std::string Word::GetString(const vector<FactorType> factorType,bool endWithBlank) const { stringstream strme; - CHECK(factorType.size() <= MAX_NUM_FACTORS); const std::string& factorDelimiter = StaticData::Instance().GetFactorDelimiter(); bool firstPass = true; for (unsigned int i = 0 ; i < factorType.size() ; i++) { + UTIL_THROW_IF(factorType[i] >= MAX_NUM_FACTORS, util::Exception, + "Trying to reference factor " << factorType[i] << ". Max factor is " << MAX_NUM_FACTORS); + const Factor *factor = m_factorArray[factorType[i]]; if (factor != NULL) { if (firstPass) { |