mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 05:14:36 +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);
|
||||
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user