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.cpp
parent6be932c1f75a9ca171336a253f0f64659a30fa1a (diff)
Added some deterministic tie-breaking to CompareHypothesisTotalScore().
Diffstat (limited to 'moses/Hypothesis.cpp')
-rw-r--r--moses/Hypothesis.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/moses/Hypothesis.cpp b/moses/Hypothesis.cpp
index c43aed01e..4c8598638 100644
--- a/moses/Hypothesis.cpp
+++ b/moses/Hypothesis.cpp
@@ -632,6 +632,23 @@ OutputWordAlignment(vector<xmlrpc_c::value>& out) const
tmp[i]->OutputLocalWordAlignment(out);
}
+bool
+Hypothesis::
+beats(Hypothesis const& b) const
+{
+ if (m_totalScore != b.m_totalScore)
+ return m_totalScore > b.m_totalScore;
+ else if (m_futureScore != b.m_futureScore)
+ return m_futureScore > b.m_futureScore;
+ else if (m_prevHypo)
+ return b.m_prevHypo ? m_prevHypo->beats(*b.m_prevHypo) : true;
+ else return false;
+ // TO DO: add more tie breaking here
+ // results. We should compare other property of the hypos here.
+ // On the other hand, how likely is this going to happen?
+}
+
+
#endif