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 <hieu@hoang.co.uk>2014-04-29 17:41:20 +0400
committerHieu Hoang <hieu@hoang.co.uk>2014-04-29 17:41:20 +0400
commit4c74a5d6383435ad4709e0e1cd4d1101a0f61ad2 (patch)
tree838570a9c583c10c39e2b605cca83b74938b9660 /moses/TranslationOptionCollectionLattice.cpp
parent6182750b7077f226f2eb96a8b5b97be72d274c74 (diff)
bug in lattice decoding. Some arcs can span more than 1 node
Diffstat (limited to 'moses/TranslationOptionCollectionLattice.cpp')
-rw-r--r--moses/TranslationOptionCollectionLattice.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/moses/TranslationOptionCollectionLattice.cpp b/moses/TranslationOptionCollectionLattice.cpp
index 59be2b5b8..f2c18132b 100644
--- a/moses/TranslationOptionCollectionLattice.cpp
+++ b/moses/TranslationOptionCollectionLattice.cpp
@@ -37,14 +37,17 @@ TranslationOptionCollectionLattice::TranslationOptionCollectionLattice(
const std::vector<size_t> &nextNodes = input.GetNextNodes(startPos);
- WordsRange range(startPos, startPos);
- const NonTerminalSet &labels = input.GetLabelSet(startPos, startPos);
-
const ConfusionNet::Column &col = input.GetColumn(startPos);
for (size_t i = 0; i < col.size(); ++i) {
const Word &word = col[i].first;
UTIL_THROW_IF2(word.IsEpsilon(), "Epsilon not supported");
+ size_t nextNode = nextNodes[i];
+ size_t endPos = startPos + nextNode - 1;
+
+ WordsRange range(startPos, endPos);
+ const NonTerminalSet &labels = input.GetLabelSet(startPos, endPos);
+
Phrase subphrase;
subphrase.AddWord(word);
@@ -53,9 +56,7 @@ TranslationOptionCollectionLattice::TranslationOptionCollectionLattice(
InputPath *path = new InputPath(subphrase, labels, range, NULL, inputScore);
- size_t nextNode = nextNodes[i];
path->SetNextNode(nextNode);
-
m_inputPathQueue.push_back(path);
}
}
@@ -135,7 +136,7 @@ void TranslationOptionCollectionLattice::CreateTranslationOptions()
const WordsRange &range = path.GetWordsRange();
if (tpColl && tpColl->GetSize()) {
- TargetPhraseCollection::const_iterator iter;
+ TargetPhraseCollection::const_iterator iter;
for (iter = tpColl->begin(); iter != tpColl->end(); ++iter) {
const TargetPhrase &tp = **iter;
TranslationOption *transOpt = new TranslationOption(range, tp);