diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2014-06-13 17:53:11 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2014-06-13 17:53:11 +0400 |
commit | a1053a9df845a7b5582173afaeb656391c550eae (patch) | |
tree | 824e5849f9bbd0f79b240afb6fb1eec0ebcb5bb5 /moses/TreeInput.cpp | |
parent | 30b383c60f69c3e5ca27cd157ec93636f778a4b2 (diff) |
warning for empty tags, instead of error
Diffstat (limited to 'moses/TreeInput.cpp')
-rw-r--r-- | moses/TreeInput.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/moses/TreeInput.cpp b/moses/TreeInput.cpp index 1ae172532..2b246aee5 100644 --- a/moses/TreeInput.cpp +++ b/moses/TreeInput.cpp @@ -145,8 +145,12 @@ bool TreeInput::ProcessAndStripXMLTags(string &line, std::vector<XMLParseOutput> VERBOSE(3,"XML TAG " << tagName << " (" << tagContent << ") spanning " << startPos << " to " << (endPos-1) << " complete, commence processing" << endl); - if (startPos >= endPos) { - TRACE_ERR("ERROR: tag " << tagName << " must span at least one word: " << line << endl); + if (startPos == endPos) { + TRACE_ERR("WARNING: tag " << tagName << " span is empty. Ignoring: " << line << endl); + continue; + } + else if (startPos > endPos) { + TRACE_ERR("ERROR: tag " << tagName << " startPos > endPos: " << line << endl); return false; } |