diff options
author | Patrick Simianer <p@simianer.de> | 2011-09-26 18:24:58 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2011-09-26 18:24:58 +0200 |
commit | e16b311246f9f2c309b257debd5f50a28b04802b (patch) | |
tree | ae8cbb64cd710d92614af5ad81a83cccaaa9c32e /dtrain/ksampler.h | |
parent | 044e1f2f7a074d9940c30eee7b800beb070c706d (diff) |
score refactoring #1
Diffstat (limited to 'dtrain/ksampler.h')
-rw-r--r-- | dtrain/ksampler.h | 8 |
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); } } |