summaryrefslogtreecommitdiff
path: root/extractor/matching.cc
blob: 16a3ed6f07090c709e7dd2e8d55b4e8054c4b9d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include "matching.h"

Matching::Matching(vector<int>::iterator start, int len, int sentence_id) :
    positions(start, start + len), sentence_id(sentence_id) {}

vector<int> Matching::Merge(const Matching& other, int num_subpatterns) const {
  vector<int> result = positions;
  if (num_subpatterns > positions.size()) {
    result.push_back(other.positions.back());
  }
  return result;
}