summaryrefslogtreecommitdiff
path: root/extractor/sampler.h
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-02-01 16:11:10 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-02-01 16:11:10 +0000
commit252fb164c208ec8f3005f8a652eb3b48c0644e3d (patch)
tree7199cb668e77ef89c7bcccb37d70554e3b52c2a5 /extractor/sampler.h
parent4ab84a0be28fdb6c0c421fe5ba5e09cfa298f2d1 (diff)
Second working commit.
Diffstat (limited to 'extractor/sampler.h')
-rw-r--r--extractor/sampler.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/extractor/sampler.h b/extractor/sampler.h
new file mode 100644
index 00000000..3b3e3a4d
--- /dev/null
+++ b/extractor/sampler.h
@@ -0,0 +1,24 @@
+#ifndef _SAMPLER_H_
+#define _SAMPLER_H_
+
+#include <memory>
+
+using namespace std;
+
+class PhraseLocation;
+class SuffixArray;
+
+class Sampler {
+ public:
+ Sampler(shared_ptr<SuffixArray> suffix_array, int max_samples);
+
+ PhraseLocation Sample(const PhraseLocation& location) const;
+
+ private:
+ int Round(double x) const;
+
+ shared_ptr<SuffixArray> suffix_array;
+ int max_samples;
+};
+
+#endif