summaryrefslogtreecommitdiff
path: root/extractor/matchings_sampler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'extractor/matchings_sampler.cc')
-rw-r--r--extractor/matchings_sampler.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/extractor/matchings_sampler.cc b/extractor/matchings_sampler.cc
index bb916e49..75a62366 100644
--- a/extractor/matchings_sampler.cc
+++ b/extractor/matchings_sampler.cc
@@ -30,8 +30,9 @@ int MatchingsSampler::GetPosition(const PhraseLocation& location,
void MatchingsSampler::AppendMatching(vector<int>& samples, int index,
const PhraseLocation& location) const {
- copy(location.matchings->begin() + index,
- location.matchings->begin() + index + location.num_subpatterns,
+ int start = index * location.num_subpatterns;
+ copy(location.matchings->begin() + start,
+ location.matchings->begin() + start + location.num_subpatterns,
back_inserter(samples));
}