summaryrefslogtreecommitdiff
path: root/dtrain/kbestget.h
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2011-09-25 22:59:24 +0200
committerPatrick Simianer <p@simianer.de>2011-09-25 22:59:24 +0200
commit899a30eb4e53d539ee0b846f38d7524fec811864 (patch)
tree77d02d7c6746b8d5249bca9900fdaef4c15ccf77 /dtrain/kbestget.h
parentec8e1b92b0a898754eb11d72741c8af39854c706 (diff)
size_t -> unsigned
Diffstat (limited to 'dtrain/kbestget.h')
-rw-r--r--dtrain/kbestget.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/dtrain/kbestget.h b/dtrain/kbestget.h
index 403384de..935998a0 100644
--- a/dtrain/kbestget.h
+++ b/dtrain/kbestget.h
@@ -22,11 +22,11 @@ struct HypSampler : public DecoderObserver
struct KBestGetter : public HypSampler
{
- const size_t k_;
+ const unsigned k_;
const string filter_type_;
vector<ScoredHyp> s_;
- KBestGetter(const size_t k, const string filter_type) :
+ KBestGetter(const unsigned k, const string filter_type) :
k_(k), filter_type_(filter_type) {}
virtual void
@@ -51,9 +51,11 @@ struct KBestGetter : public HypSampler
KBestUnique(const Hypergraph& forest)
{
s_.clear();
- KBest::KBestDerivations<vector<WordID>, ESentenceTraversal, KBest::FilterUnique, prob_t, EdgeProb> kbest(forest, k_);
- for (size_t i = 0; i < k_; ++i) {
- const KBest::KBestDerivations<vector<WordID>, ESentenceTraversal, KBest::FilterUnique, prob_t, EdgeProb>::Derivation* d =
+ KBest::KBestDerivations<vector<WordID>, ESentenceTraversal,
+ KBest::FilterUnique, prob_t, EdgeProb> kbest(forest, k_);
+ for (unsigned i = 0; i < k_; ++i) {
+ const KBest::KBestDerivations<vector<WordID>, ESentenceTraversal, KBest::FilterUnique,
+ prob_t, EdgeProb>::Derivation* d =
kbest.LazyKthBest(forest.nodes_.size() - 1, i);
if (!d) break;
ScoredHyp h;
@@ -69,7 +71,7 @@ struct KBestGetter : public HypSampler
{
s_.clear();
KBest::KBestDerivations<vector<WordID>, ESentenceTraversal> kbest(forest, k_);
- for (size_t i = 0; i < k_; ++i) {
+ for (unsigned i = 0; i < k_; ++i) {
const KBest::KBestDerivations<vector<WordID>, ESentenceTraversal>::Derivation* d =
kbest.LazyKthBest(forest.nodes_.size() - 1, i);
if (!d) break;