summaryrefslogtreecommitdiff
path: root/extractor/fast_intersector.cc
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-06-25 17:28:54 +0100
committerPaul Baltescu <pauldb89@gmail.com>2013-06-25 17:28:54 +0100
commit36bc55a33b5f075f6479c64f94d60ecbbd1f3270 (patch)
treeb32b113529eac6ed35458bb2675850343a16432d /extractor/fast_intersector.cc
parentcd4dbb5c0b581efb0369330ea330f2b473628a96 (diff)
Undo last commit.
Diffstat (limited to 'extractor/fast_intersector.cc')
-rw-r--r--extractor/fast_intersector.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/extractor/fast_intersector.cc b/extractor/fast_intersector.cc
index 5360c1da..a8591a72 100644
--- a/extractor/fast_intersector.cc
+++ b/extractor/fast_intersector.cc
@@ -20,13 +20,10 @@ FastIntersector::FastIntersector(shared_ptr<SuffixArray> suffix_array,
vocabulary(vocabulary),
max_rule_span(max_rule_span),
min_gap_size(min_gap_size) {
- auto precomputed_collocations = precomputation->GetCollocations();
- for (auto item: precomputed_collocations) {
- vector<int> phrase = ConvertPhrase(item.first);
- vector<int> location = item.second;
- vector<int>& phrase_collocations = collocations[phrase];
- phrase_collocations.insert(phrase_collocations.end(), location.begin(),
- location.end());
+ Index precomputed_collocations = precomputation->GetCollocations();
+ for (pair<vector<int>, vector<int>> entry: precomputed_collocations) {
+ vector<int> phrase = ConvertPhrase(entry.first);
+ collocations[phrase] = entry.second;
}
}