summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-05-23 20:41:17 +0100
committerPaul Baltescu <pauldb89@gmail.com>2013-05-23 20:41:17 +0100
commit35d2c095ba6a912272f2fcc8322ece4213ada82b (patch)
tree71efa6fe794e3331b2025ac4f643ab0c48c7f626
parentba206aaac1d95e76126443c9e7ccc5941e879849 (diff)
Support completely unaligned sentences.
-rw-r--r--extractor/alignment.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/extractor/alignment.cc b/extractor/alignment.cc
index 1aea34b3..f8326886 100644
--- a/extractor/alignment.cc
+++ b/extractor/alignment.cc
@@ -23,8 +23,8 @@ Alignment::Alignment(const string& filename) {
boost::split(items, line, boost::is_any_of(" -"));
vector<pair<int, int> > alignment;
alignment.reserve(items.size() / 2);
- for (size_t i = 0; i < items.size(); i += 2) {
- alignment.push_back(make_pair(stoi(items[i]), stoi(items[i + 1])));
+ for (size_t i = 1; i < items.size(); i += 2) {
+ alignment.push_back(make_pair(stoi(items[i - 1]), stoi(items[i])));
}
alignments.push_back(alignment);
}