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:
authorHieu Hoang <hieuhoang@gmail.com>2014-07-11 19:26:48 +0400
committerHieu Hoang <hieuhoang@gmail.com>2014-07-11 19:26:48 +0400
commita402523ef57f09f72d5ab3b59967047de08d64b3 (patch)
tree6b6441af2a9adf7ec2331862b761e9cddea0d708 /moses/ChartHypothesis.cpp
parent8f5dc2b9e7949af747b22b85714265e8f7ee481c (diff)
calculate baseline score without optimisation
Diffstat (limited to 'moses/ChartHypothesis.cpp')
-rw-r--r--moses/ChartHypothesis.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/moses/ChartHypothesis.cpp b/moses/ChartHypothesis.cpp
index dec3bd308..7b32559b7 100644
--- a/moses/ChartHypothesis.cpp
+++ b/moses/ChartHypothesis.cpp
@@ -151,24 +151,26 @@ Phrase ChartHypothesis::GetOutputPhrase() const
void ChartHypothesis::GetOutputPhrase(int leftRightMost, int numWords, Phrase &outPhrase) const
{
- int targetSize = GetCurrTargetPhrase().GetSize();
+ const TargetPhrase &tp = GetCurrTargetPhrase();
+
+ int targetSize = tp.GetSize();
for (int i = 0; i < targetSize; ++i) {
int pos;
if (leftRightMost == 1) {
pos = i;
}
else if (leftRightMost == 2) {
- pos = targetSize - i;
+ pos = targetSize - i - 1;
}
else {
abort();
}
- const Word &word = GetCurrTargetPhrase().GetWord(pos);
+ const Word &word = tp.GetWord(pos);
if (word.IsNonTerminal()) {
// non-term. fill out with prev hypo
- size_t nonTermInd = GetCurrTargetPhrase().GetAlignNonTerm().GetNonTermIndexMap()[pos];
+ size_t nonTermInd = tp.GetAlignNonTerm().GetNonTermIndexMap()[pos];
const ChartHypothesis *prevHypo = m_prevHypos[nonTermInd];
prevHypo->GetOutputPhrase(outPhrase);
} else {