From 4ab84a0be28fdb6c0c421fe5ba5e09cfa298f2d1 Mon Sep 17 00:00:00 2001 From: Paul Baltescu Date: Mon, 28 Jan 2013 11:56:31 +0000 Subject: Initial working commit. --- extractor/matching.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 extractor/matching.cc (limited to 'extractor/matching.cc') diff --git a/extractor/matching.cc b/extractor/matching.cc new file mode 100644 index 00000000..16a3ed6f --- /dev/null +++ b/extractor/matching.cc @@ -0,0 +1,12 @@ +#include "matching.h" + +Matching::Matching(vector::iterator start, int len, int sentence_id) : + positions(start, start + len), sentence_id(sentence_id) {} + +vector Matching::Merge(const Matching& other, int num_subpatterns) const { + vector result = positions; + if (num_subpatterns > positions.size()) { + result.push_back(other.positions.back()); + } + return result; +} -- cgit v1.2.3