summaryrefslogtreecommitdiff
path: root/dtrain/ksampler.h
diff options
context:
space:
mode:
Diffstat (limited to 'dtrain/ksampler.h')
-rw-r--r--dtrain/ksampler.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/dtrain/ksampler.h b/dtrain/ksampler.h
index 17b0ba56..767dc42e 100644
--- a/dtrain/ksampler.h
+++ b/dtrain/ksampler.h
@@ -1,7 +1,13 @@
#ifndef _DTRAIN_KSAMPLER_H_
#define _DTRAIN_KSAMPLER_H_
+#include "kbestget.h"
#include "hgsampler.h"
+#include <vector>
+#include <string>
+
+using namespace std;
+
#include "kbest.h" // cdec
#include "sampler.h"
@@ -14,6 +20,7 @@ struct KSampler : public HypSampler
const unsigned k_;
vector<ScoredHyp> s_;
MT19937* prng_;
+ score_t (*scorer)(NgramCounts&, const unsigned, const unsigned, unsigned, vector<score_t>);
explicit KSampler(const unsigned k, MT19937* prng) :
k_(k), prng_(prng) {}
@@ -35,6 +42,7 @@ struct KSampler : public HypSampler
h.w = samples[i].words;
h.f = samples[i].fmap;
h.model = log(samples[i].model_score);
+ h.rank = i;
s_.push_back(h);
}
}