Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Germann <Ulrich.Germann@gmail.com>2015-11-03 22:01:20 +0300
committerUlrich Germann <Ulrich.Germann@gmail.com>2015-11-03 22:01:20 +0300
commit876fe6a412e5bdcb45ed22f0e09da92cfad2600a (patch)
tree4e68db3c33a06caf506f2c6c594ae2e96c3338fe /moses/Hypothesis.h
parent6be932c1f75a9ca171336a253f0f64659a30fa1a (diff)
Added some deterministic tie-breaking to CompareHypothesisTotalScore().
Diffstat (limited to 'moses/Hypothesis.h')
-rw-r--r--moses/Hypothesis.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/moses/Hypothesis.h b/moses/Hypothesis.h
index 59d03d4bd..b5e8c2258 100644
--- a/moses/Hypothesis.h
+++ b/moses/Hypothesis.h
@@ -1,6 +1,4 @@
-// $Id$
-// vim:tabstop=2
-
+// -*- mode: c++; indent-tabs-mode: nil; tab-width:2 -*-
/***********************************************************************
Moses - factored phrase-based language decoder
Copyright (C) 2006 University of Edinburgh
@@ -69,7 +67,6 @@ typedef std::vector<Hypothesis*> ArcList;
class Hypothesis
{
friend std::ostream& operator<<(std::ostream&, const Hypothesis&);
-
protected:
const Hypothesis* m_prevHypo; /*! backpointer to previous hypothesis (from which this one was created) */
const Bitmap &m_sourceCompleted; /*! keeps track of which words have been translated so far */
@@ -283,6 +280,8 @@ public:
void OutputLocalWordAlignment(std::vector<xmlrpc_c::value>& dest) const;
#endif
+ bool beats(Hypothesis const& b) const;
+
};
@@ -290,8 +289,8 @@ std::ostream& operator<<(std::ostream& out, const Hypothesis& hypothesis);
// sorting helper
struct CompareHypothesisTotalScore {
- bool operator()(const Hypothesis* hypo1, const Hypothesis* hypo2) const {
- return hypo1->GetTotalScore() > hypo2->GetTotalScore();
+ bool operator()(const Hypothesis* a, const Hypothesis* b) const {
+ return a->beats(*b);
}
};