CreateAlignmentInfo is now only called when UseAlignmentInfo is true. Shrinks phrase table memory size when extra data is not needed.

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1941 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
jdschroeder 2008-11-13 17:43:15 +00:00
parent 102856bf84
commit 6eab281ce6

View File

@ -132,23 +132,16 @@ bool PhraseDictionaryMemory::Load(const std::vector<FactorType> &input
targetPhrase.SetSourcePhrase(&sourcePhrase);
targetPhrase.CreateFromString( output, targetPhraseString, factorDelimiter);
if (!staticData.UseAlignmentInfo()){
UniformAlignment(sourceAlignString, sourcePhrase.GetSize(), targetPhrase.GetSize());
UniformAlignment(targetAlignString, targetPhrase.GetSize(), sourcePhrase.GetSize());
/*
EmptyAlignment(sourceAlignString, sourcePhrase.GetSize());
EmptyAlignment(targetAlignString, targetPhrase.GetSize());
*/
// load alignment info only when present and relevant
if (staticData.UseAlignmentInfo()){
if (numElement==3){
stringstream strme;
strme << "You are using AlignmentInfo, but this info not available in the Phrase Table. Only " <<numElement<<" fields on line " << line_num;
UserMessage::Add(strme.str());
return false;
}
targetPhrase.CreateAlignmentInfo(sourceAlignString, targetAlignString);
}
else if (numElement==3){
stringstream strme;
strme << "You are using AlignmentInfo, but this info not available in the Phrase Table. Only " <<numElement<<" fields on line " << line_num;
UserMessage::Add(strme.str());
return false;
}
// alignment info
targetPhrase.CreateAlignmentInfo(sourceAlignString, targetAlignString);
// component score, for n-best output
std::vector<float> scv(scoreVector.size());