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:
authorPhil Williams <philip.williams@mac.com>2014-04-15 20:34:21 +0400
committerPhil Williams <philip.williams@mac.com>2014-04-15 20:34:21 +0400
commit66d0fe81e295dfd976941b2e1112c65d7903c8b0 (patch)
tree2fbadf947746ce367529d69c62144e17ff0bd99a /moses/ChartHypothesis.cpp
parent75213181aebda799053cd556c3869d935bda4a4d (diff)
moses_chart: add ChartKBestExtractor (not enabled yet)
Implements algorithm 3 from Huang and Chiang (2005)
Diffstat (limited to 'moses/ChartHypothesis.cpp')
-rw-r--r--moses/ChartHypothesis.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/moses/ChartHypothesis.cpp b/moses/ChartHypothesis.cpp
index 01eb49ccc..212a28d23 100644
--- a/moses/ChartHypothesis.cpp
+++ b/moses/ChartHypothesis.cpp
@@ -66,6 +66,22 @@ ChartHypothesis::ChartHypothesis(const ChartTranslationOptions &transOpt,
}
}
+// Intended to be used by ChartKBestExtractor only. This creates a mock
+// ChartHypothesis for use by the extractor's top-level target vertex.
+ChartHypothesis::ChartHypothesis(const ChartHypothesis &pred,
+ const ChartKBestExtractor & /*unused*/)
+ :m_currSourceWordsRange(pred.m_currSourceWordsRange)
+ ,m_scoreBreakdown(pred.m_scoreBreakdown)
+ ,m_totalScore(pred.m_totalScore)
+ ,m_arcList(NULL)
+ ,m_winningHypo(NULL)
+ ,m_manager(pred.m_manager)
+ ,m_id(pred.m_manager.GetNextHypoId())
+{
+ // One predecessor, which is an existing top-level ChartHypothesis.
+ m_prevHypos.push_back(&pred);
+}
+
ChartHypothesis::~ChartHypothesis()
{
// delete feature function states