summaryrefslogtreecommitdiff
path: root/extractor/sampler.h
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-11-27 14:33:36 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-11-27 14:33:36 +0000
commita6e6a369f40d8fb6a191fd7f74fc5efa8bfae2a0 (patch)
treeab2ea6c2b00adb438929cf34dc334c11f2bc6396 /extractor/sampler.h
parent8f65daa5bdaddaac24cea4df70049757536d6080 (diff)
Unify sampling backoff strategy.
Diffstat (limited to 'extractor/sampler.h')
-rw-r--r--extractor/sampler.h22
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