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/sampler.h | |
parent | 7b7167248cd605c9f5bd91b3c87e2826d2336a9f (diff) |
Unify sampling backoff strategy.
Diffstat (limited to 'extractor/sampler.h')
-rw-r--r-- | extractor/sampler.h | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/extractor/sampler.h b/extractor/sampler.h index bd8a5876..3c4e37f1 100644 --- a/extractor/sampler.h +++ b/extractor/sampler.h @@ -4,38 +4,20 @@ #include <memory> #include <unordered_set> -#include "data_array.h" - using namespace std; namespace extractor { class PhraseLocation; -class SuffixArray; /** - * Provides uniform sampling for a PhraseLocation. + * Base sampler class. */ class Sampler { public: - Sampler(shared_ptr<SuffixArray> suffix_array, int max_samples); - - virtual ~Sampler(); - - // Samples uniformly at most max_samples phrase occurrences. virtual PhraseLocation Sample( const PhraseLocation& location, - const unordered_set<int>& blacklisted_sentence_ids) const; - - protected: - Sampler(); - - private: - // Round floating point number to the nearest integer. - int Round(double x) const; - - shared_ptr<SuffixArray> suffix_array; - int max_samples; + const unordered_set<int>& blacklisted_sentence_ids) const = 0; }; } // namespace extractor |