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
commit044e1f2f7a074d9940c30eee7b800beb070c706d (patch)
tree3268bd7745a351d64d080f95001b4aa726d3a690 /dtrain/kbestget.h
parentb0a9e224cdb3065027c9dc4aa1598ab4bd3b097c (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;