mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-27 05:55:02 +03:00
Merge branch 'master' of https://github.com/moses-smt/mosesdecoder
This commit is contained in:
commit
ae4ab9aae0
@ -37,14 +37,17 @@ TranslationOptionCollectionLattice::TranslationOptionCollectionLattice(
|
|||||||
|
|
||||||
const std::vector<size_t> &nextNodes = input.GetNextNodes(startPos);
|
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);
|
const ConfusionNet::Column &col = input.GetColumn(startPos);
|
||||||
for (size_t i = 0; i < col.size(); ++i) {
|
for (size_t i = 0; i < col.size(); ++i) {
|
||||||
const Word &word = col[i].first;
|
const Word &word = col[i].first;
|
||||||
UTIL_THROW_IF2(word.IsEpsilon(), "Epsilon not supported");
|
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;
|
Phrase subphrase;
|
||||||
subphrase.AddWord(word);
|
subphrase.AddWord(word);
|
||||||
|
|
||||||
@ -53,9 +56,7 @@ TranslationOptionCollectionLattice::TranslationOptionCollectionLattice(
|
|||||||
|
|
||||||
InputPath *path = new InputPath(subphrase, labels, range, NULL, inputScore);
|
InputPath *path = new InputPath(subphrase, labels, range, NULL, inputScore);
|
||||||
|
|
||||||
size_t nextNode = nextNodes[i];
|
|
||||||
path->SetNextNode(nextNode);
|
path->SetNextNode(nextNode);
|
||||||
|
|
||||||
m_inputPathQueue.push_back(path);
|
m_inputPathQueue.push_back(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user