summaryrefslogtreecommitdiff
path: root/extractor/linear_merger.h
blob: 6a69b8046dc7cd97dff8a94bab8e8396d92dc91d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef _LINEAR_MERGER_H_
#define _LINEAR_MERGER_H_

#include <memory>
#include <vector>

using namespace std;

class MatchingComparator;
class Phrase;
class PhraseLocation;
class DataArray;
class Vocabulary;

class LinearMerger {
 public:
  LinearMerger(shared_ptr<Vocabulary> vocabulary,
               shared_ptr<DataArray> data_array,
               shared_ptr<MatchingComparator> comparator);

  virtual ~LinearMerger();

  virtual void Merge(
      vector<int>& locations, const Phrase& phrase, const Phrase& suffix,
      vector<int>::iterator prefix_start, vector<int>::iterator prefix_end,
      vector<int>::iterator suffix_start, vector<int>::iterator suffix_end,
      int prefix_subpatterns, int suffix_subpatterns) const;

 protected:
  LinearMerger();

 private:
  shared_ptr<Vocabulary> vocabulary;
  shared_ptr<DataArray> data_array;
  shared_ptr<MatchingComparator> comparator;
};

#endif