diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2013-11-19 22:52:15 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2013-11-19 22:52:15 +0400 |
commit | c2ffc022eab102fc2e1593c435c1eaa389583278 (patch) | |
tree | 528d30540bde0dce46349b1e9a3f0cd122afcbbf /moses/TrellisPath.cpp | |
parent | 22864c2b4b154b2c69518bf773fe73f4c557af0a (diff) |
replace CHECK with UTIL_THROW_IF in Moses
Diffstat (limited to 'moses/TrellisPath.cpp')
-rw-r--r-- | moses/TrellisPath.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/moses/TrellisPath.cpp b/moses/TrellisPath.cpp index fed8f9658..ea065e54d 100644 --- a/moses/TrellisPath.cpp +++ b/moses/TrellisPath.cpp @@ -199,7 +199,8 @@ Phrase TrellisPath::GetSurfacePhrase() const for (size_t i = 0 ; i < outputFactor.size() ; i++) { FactorType factorType = outputFactor[i]; const Factor *factor = targetPhrase.GetFactor(pos, factorType); - CHECK(factor); + UTIL_THROW_IF(factor == NULL, util::Exception, + "No factor " << factorType << " at position " << pos); newWord[factorType] = factor; } } @@ -222,7 +223,7 @@ WordsRange TrellisPath::GetTargetWordsRange(const Hypothesis &hypo) const } // have to give a hypo in the trellis path, but u didn't. - CHECK(false); + UTIL_THROW(util::Exception, "Hypothesis not found"); return WordsRange(NOT_FOUND, NOT_FOUND); } |