diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2014-05-08 14:26:17 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2014-05-08 14:26:17 +0400 |
commit | d12f91841add4e0bdbcf10b445bdac27eac1169c (patch) | |
tree | 20cb79eba3be51a886b270e3c29071f0c5547c5a /moses/ChartKBestExtractor.cpp | |
parent | d7380d6d9e0c5f88eb0ee4973f49e4c4e3900b9f (diff) |
Segfault in nbest list creation. UTIL_THROW_IF is the opposite of assert
Diffstat (limited to 'moses/ChartKBestExtractor.cpp')
-rw-r--r-- | moses/ChartKBestExtractor.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/moses/ChartKBestExtractor.cpp b/moses/ChartKBestExtractor.cpp index 3a16198fc..af2edc3bb 100644 --- a/moses/ChartKBestExtractor.cpp +++ b/moses/ChartKBestExtractor.cpp @@ -27,6 +27,8 @@ #include <vector> +using namespace std; + namespace Moses { @@ -52,7 +54,7 @@ void ChartKBestExtractor::Extract( // recombined. for (++p; p != topLevelHypos.end(); ++p) { // Check that the first item in topLevelHypos really was the best. - UTIL_THROW_IF2((*p)->GetTotalScore() <= bestTopLevelHypo.GetTotalScore(), + UTIL_THROW_IF2((*p)->GetTotalScore() > bestTopLevelHypo.GetTotalScore(), "top-level hypotheses are not correctly sorted"); // Note: there's no need for a smart pointer here: supremeHypo will take // ownership of altHypo. |