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-11 02:05:13 +0300
committerUlrich Germann <Ulrich.Germann@gmail.com>2015-11-11 02:05:13 +0300
commitd7278293877afe443a8668d5abea25bb37542c6e (patch)
treef3e380c11d4b5f6f117ea69922b457de4a7ef50c /moses/TrellisPath.h
parent806f888c10ac02eba67454d55aa0880464e4f284 (diff)
parentb733804fdcf20a5a9e822861471248c8fdbc0e2d (diff)
Merge branch 'master' of https://github.com/modernmt/mosesdecoder
Conflicts: moses/parameters/InputOptions.cpp moses/parameters/InputOptions.h
Diffstat (limited to 'moses/TrellisPath.h')
-rw-r--r--moses/TrellisPath.h25
1 files changed, 16 insertions, 9 deletions
diff --git a/moses/TrellisPath.h b/moses/TrellisPath.h
index 1407f1281..3367d932d 100644
--- a/moses/TrellisPath.h
+++ b/moses/TrellisPath.h
@@ -1,5 +1,4 @@
-// $Id$
-
+// -*- mode: c++; indent-tabs-mode: nil; tab-width:2 -*-
/***********************************************************************
Moses - factored phrase-based language decoder
Copyright (C) 2006 University of Edinburgh
@@ -34,10 +33,12 @@ namespace Moses
class TrellisPathCollection;
class TrellisPathList;
-/** Encapsulate the set of hypotheses/arcs that goes from decoding 1 phrase to all the source phrases
- * to reach a final translation. For the best translation, this consist of all hypotheses, for the other
- * n-best paths, the node on the path can consist of hypotheses or arcs.
- * Used by phrase-based decoding
+/** Encapsulate the set of hypotheses/arcs that goes from decoding 1
+ * phrase to all the source phrases to reach a final
+ * translation. For the best translation, this consist of all
+ * hypotheses, for the other n-best paths, the node on the path
+ * can consist of hypotheses or arcs. Used by phrase-based
+ * decoding
*/
class TrellisPath
{
@@ -46,9 +47,10 @@ class TrellisPath
protected:
std::vector<const Hypothesis *> m_path; //< list of hypotheses/arcs
- size_t m_prevEdgeChanged; /**< the last node that was wiggled to create this path
- , or NOT_FOUND if this path is the best trans so consist of only hypos
- */
+ size_t m_prevEdgeChanged;
+ /**< the last node that was wiggled to create this path
+ , or NOT_FOUND if this path is the best trans so consist of only hypos
+ */
float m_totalScore;
mutable boost::shared_ptr<ScoreComponentCollection> m_scoreBreakdown;
@@ -58,6 +60,11 @@ protected:
void InitTotalScore();
+ Manager const& manager() const {
+ UTIL_THROW_IF2(m_path.size() == 0, "zero-length trellis path");
+ return m_path[0]->GetManager();
+ }
+
public:
TrellisPath(); // not implemented