Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2014-06-13 17:53:11 +0400
committerHieu Hoang <hieuhoang@gmail.com>2014-06-13 17:53:11 +0400
commita1053a9df845a7b5582173afaeb656391c550eae (patch)
tree824e5849f9bbd0f79b240afb6fb1eec0ebcb5bb5 /moses/TreeInput.cpp
parent30b383c60f69c3e5ca27cd157ec93636f778a4b2 (diff)
warning for empty tags, instead of error
Diffstat (limited to 'moses/TreeInput.cpp')
-rw-r--r--moses/TreeInput.cpp8
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;
}