From 7df6865cc83e737410e1b6a8fc10d1380df94bf2 Mon Sep 17 00:00:00 2001 From: ilor <kailoran@gmail.com> Date: Sat, 9 Apr 2011 11:51:14 +0200 Subject: [PATCH] Fix issue #1391 (runwccl outputing extra whitespace after each line) --- wcclrun/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wcclrun/main.cpp b/wcclrun/main.cpp index f06d2c9..9a39504 100644 --- a/wcclrun/main.cpp +++ b/wcclrun/main.cpp @@ -193,7 +193,7 @@ void Runner::do_sentence(const boost::shared_ptr<Corpus2::Sentence>& sentence) } foreach (const std::vector< UnicodeString >& line, outputs) { - for (size_t i = 0; i < line.size(); ++i) { + for (size_t i = 0; i < line.size() - 1; ++i) { UnicodeString u = line[i]; if (tabs) { std::cout << PwrNlp::to_utf8(line[i]) << "\t"; @@ -202,6 +202,9 @@ void Runner::do_sentence(const boost::shared_ptr<Corpus2::Sentence>& sentence) std::cout << PwrNlp::to_utf8(u); } } + if (!line.empty()) { + std::cout << PwrNlp::to_utf8(line.back()); + } std::cout << "\n"; } } -- GitLab