diff --git a/moses/Parameter.cpp b/moses/Parameter.cpp index ab9f2777c..55d5d59bb 100644 --- a/moses/Parameter.cpp +++ b/moses/Parameter.cpp @@ -488,7 +488,7 @@ void Parameter::ConvertWeightArgsPhraseModel(const string &oldWeightName) ptType = "PhraseDictionaryOnDisk"; break; case SCFG: - ptType = "PhraseDictionarySCFG"; + ptType = "PhraseDictionaryMemory"; break; case Compact: ptType = "PhraseDictionaryCompact"; diff --git a/moses/TargetPhrase.cpp b/moses/TargetPhrase.cpp index a2cc58c6c..ed311239e 100644 --- a/moses/TargetPhrase.cpp +++ b/moses/TargetPhrase.cpp @@ -236,18 +236,6 @@ void TargetPhrase::SetScore(const FeatureFunction* producer, const Scores &score m_fullScore = m_scoreBreakdown.GetWeightedScore(); } - -void TargetPhrase::SetWeights(const FeatureFunction* translationScoreProducer, const vector &weightT) -{ - // calling this function in case of confusion net input is undefined - CHECK(StaticData::Instance().GetInputType()==SentenceInput); - - /* one way to fix this, you have to make sure the weightT contains (in - addition to the usual phrase translation scaling factors) the input - weight factor as last element - */ -} - TargetPhrase *TargetPhrase::MergeNext(const TargetPhrase &inputPhrase) const { if (! IsCompatible(inputPhrase)) { diff --git a/moses/TargetPhrase.h b/moses/TargetPhrase.h index 1e0789b8c..40b0ca17e 100644 --- a/moses/TargetPhrase.h +++ b/moses/TargetPhrase.h @@ -95,9 +95,6 @@ public: // used by for unknown word proc in chart decoding void SetScore(const FeatureFunction* producer, const Scores &scoreVector); - - void SetWeights(const FeatureFunction*, const std::vector &weightT); - TargetPhrase *MergeNext(const TargetPhrase &targetPhrase) const; // used for translation step diff --git a/moses/XmlOption.cpp b/moses/XmlOption.cpp index 4ca12abb0..a5eba0f40 100644 --- a/moses/XmlOption.cpp +++ b/moses/XmlOption.cpp @@ -28,6 +28,7 @@ #include "StaticData.h" #include "WordsRange.h" #include "TargetPhrase.h" +#include "DummyScoreProducers.h" namespace Moses { @@ -341,7 +342,11 @@ bool ProcessAndStripXMLTags(string &line, vector &res, ReorderingCon WordsRange range(startPos,endPos-1); // span covered by phrase TargetPhrase targetPhrase; targetPhrase.CreateFromString(Output, outputFactorOrder,altTexts[i],factorDelimiter); + targetPhrase.SetScore(scoreValue); + + vector wp(1, - targetPhrase.GetSize()); + targetPhrase.SetScore(StaticData::Instance().GetWordPenaltyProducer() , wp); // TODO: targetPhrase.SetSourcePhrase() ? XmlOption *option = new XmlOption(range,targetPhrase);