diff options
author | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-06-29 17:21:28 +0000 |
---|---|---|
committer | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-06-29 17:21:28 +0000 |
commit | 7d3557c846bc51bbbaa04794690501dad6c3b27e (patch) | |
tree | 13d36d32eb6ee53dfec4fd733653555079439028 /extools | |
parent | d6bc05e098a2db25fc1bb74fde4c27b093dcb230 (diff) |
isolate warning messages
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@56 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'extools')
-rw-r--r-- | extools/mr_stripe_rule_reduce.cc | 1 | ||||
-rw-r--r-- | extools/sentence_pair.cc | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/extools/mr_stripe_rule_reduce.cc b/extools/mr_stripe_rule_reduce.cc index eaf1b6d7..902b6a07 100644 --- a/extools/mr_stripe_rule_reduce.cc +++ b/extools/mr_stripe_rule_reduce.cc @@ -73,6 +73,7 @@ int ReadPhraseUntilDividerOrEnd(const char* buf, const int sstart, const int end if (w == kDIV) return ptr; p->push_back(w); } + assert(p->size() > 0); return ptr; } diff --git a/extools/sentence_pair.cc b/extools/sentence_pair.cc index 91286059..5706398f 100644 --- a/extools/sentence_pair.cc +++ b/extools/sentence_pair.cc @@ -84,8 +84,10 @@ int AnnotatedParallelSentence::ReadAlignmentPoint(const char* buf, void AnnotatedParallelSentence::ParseAlignmentPoint(const char* buf, int start, int end) { short a, b; ReadAlignmentPoint(buf, start, end, false, &a, &b); - assert(a < f_len); - assert(b < e_len); + if (a >= f_len || b >= e_len) { + cerr << "(" << a << ',' << b << ") is out of bounds. INPUT=\n" << buf << endl; + exit(1); + } aligned(a,b) = true; ++f_aligned[a]; ++e_aligned[b]; |