summaryrefslogtreecommitdiff
path: root/extractor/matchings_sampler.h
blob: ca4fce93a443a3aa9f4fc94cfac07aaf769a034d (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
#ifndef _MATCHINGS_SAMPLER_H_
#define _MATCHINGS_SAMPLER_H_

#include "backoff_sampler.h"

namespace extractor {

class DataArray;

class MatchingsSampler : public BackoffSampler {
 public:
  MatchingsSampler(shared_ptr<DataArray> data_array, int max_samples);

  MatchingsSampler();

 private:
   int GetNumSubpatterns(const PhraseLocation& location) const;

   int GetRangeLow(const PhraseLocation& location) const;

   int GetRangeHigh(const PhraseLocation& location) const;

   int GetPosition(const PhraseLocation& location, int index) const;

   void AppendMatching(vector<int>& samples, int index,
                       const PhraseLocation& location) const;
};

} // namespace extractor

#endif