diff options
author | Paul Baltescu <pauldb89@gmail.com> | 2013-11-27 14:33:36 +0000 |
---|---|---|
committer | Paul Baltescu <pauldb89@gmail.com> | 2013-11-27 14:33:36 +0000 |
commit | d389d25b78e5c99366f49cdcaf788693f3c01c40 (patch) | |
tree | 03f6b880eebf2981d5ea8a9a2ec15b10eb812b97 /extractor/phrase_location_sampler.h | |
parent | 7b7167248cd605c9f5bd91b3c87e2826d2336a9f (diff) |
Unify sampling backoff strategy.
Diffstat (limited to 'extractor/phrase_location_sampler.h')
-rw-r--r-- | extractor/phrase_location_sampler.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/extractor/phrase_location_sampler.h b/extractor/phrase_location_sampler.h new file mode 100644 index 00000000..0e88335e --- /dev/null +++ b/extractor/phrase_location_sampler.h @@ -0,0 +1,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 |