summaryrefslogtreecommitdiff
path: root/extractor/phrase_location_sampler.h
blob: 0e88335ed30b0c8325c4411c69d089b1997f6436 (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
#ifndef _PHRASE_LOCATION_SAMPLER_H_
#define _PHRASE_LOCATION_SAMPLER_H_

#include <memory>

#include "sampler.h"

namespace extractor {

class MatchingsSampler;
class PhraseLocation;
class SuffixArray;
class SuffixArrayRangeSampler;

class PhraseLocationSampler : public Sampler {
 public:
  PhraseLocationSampler(shared_ptr<SuffixArray> suffix_array, int max_samples);

  // For testing only.
  PhraseLocationSampler(
      shared_ptr<MatchingsSampler> matchings_sampler,
      shared_ptr<SuffixArrayRangeSampler> suffix_array_sampler);

  PhraseLocation Sample(
      const PhraseLocation& location,
      const unordered_set<int>& blacklisted_sentence_ids) const;

 private:
  shared_ptr<MatchingsSampler> matchings_sampler;
  shared_ptr<SuffixArrayRangeSampler> suffix_array_sampler;
};

} // namespace extractor

#endif