mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-29 06:52:34 +03:00
Make sure source phrase is initialised
This commit is contained in:
parent
54433bb221
commit
1862fe54cc
@ -107,7 +107,6 @@ bool PhraseDictionaryMemory::Load(const std::vector<FactorType> &input
|
||||
|
||||
//target
|
||||
std::auto_ptr<TargetPhrase> targetPhrase(new TargetPhrase(Output));
|
||||
targetPhrase->SetSourcePhrase(sourcePhrase); // TODO(bhaddow): This is a dangling pointer
|
||||
targetPhrase->CreateFromString(output, targetPhraseString, factorDelimiter);
|
||||
|
||||
scv.clear();
|
||||
@ -175,6 +174,8 @@ bool PhraseDictionaryMemory::Load(const std::vector<FactorType> &input
|
||||
preSourceNode->Add(targetPhrase.release());
|
||||
preSourceString.assign(sourcePhraseString.data(), sourcePhraseString.size());
|
||||
}
|
||||
//Now that the source phrase is ready, we give the target phrase a copy
|
||||
targetPhrase->SetSourcePhrase(sourcePhrase);
|
||||
}
|
||||
|
||||
// sort each target phrase collection
|
||||
|
Loading…
Reference in New Issue
Block a user