summaryrefslogtreecommitdiff
path: root/extools
diff options
context:
space:
mode:
authorredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-06-29 17:21:28 +0000
committerredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-06-29 17:21:28 +0000
commit1a1f3094010bd85acbfefe64743ebde04f0b41a4 (patch)
tree18a740aac72eee3eef70d3b3788b8bca121424ad /extools
parent321b5cfe9ce2a84e62cdd185b55cbac5c133b549 (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.cc1
-rw-r--r--extools/sentence_pair.cc6
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];