diff options
Diffstat (limited to 'extractor/fast_intersector.cc')
-rw-r--r-- | extractor/fast_intersector.cc | 11 |
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; } } |