diff options
author | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2007-08-08 18:20:30 +0400 |
---|---|---|
committer | hieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230> | 2007-08-08 18:20:30 +0400 |
commit | 94b9e097f59dd3b3bc344cbd9dd90c285a924622 (patch) | |
tree | b3ce47a785e47ef660951d5be718ba504fbcff37 /moses | |
parent | f3c8483ffb2b282514980dfffefbbd83d0a27f84 (diff) |
don't skip empty lines
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1447 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'moses')
-rwxr-xr-x | moses/src/Sentence.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/moses/src/Sentence.cpp b/moses/src/Sentence.cpp index ed0df1f3f..27228d829 100755 --- a/moses/src/Sentence.cpp +++ b/moses/src/Sentence.cpp @@ -31,12 +31,12 @@ int Sentence::Read(std::istream& in,const std::vector<FactorType>& factorOrder) const std::string& factorDelimiter = StaticData::Instance().GetFactorDelimiter(); std::string line; std::map<std::string, std::string> meta; - do - { - if (getline(in, line, '\n').eof()) return 0; - line = Trim(line); - meta = ProcessAndStripSGML(line); - } while (line == ""); + + if (getline(in, line, '\n').eof()) + return 0; + line = Trim(line); + meta = ProcessAndStripSGML(line); + if (meta.find("id") != meta.end()) { this->SetTranslationId(atol(meta["id"].c_str())); } //parse XML markup in translation line |