diff --git a/moses/InputPath.cpp b/moses/InputPath.cpp index e9f84b643..cfc98e3b3 100644 --- a/moses/InputPath.cpp +++ b/moses/InputPath.cpp @@ -1,6 +1,8 @@ #include "InputPath.h" #include "ScoreComponentCollection.h" #include "TargetPhraseCollection.h" +#include "StaticData.h" +#include "TypeDef.h" namespace Moses { @@ -11,6 +13,14 @@ InputPath::InputPath(const Phrase &phrase, const WordsRange &range, const InputP ,m_range(range) ,m_inputScore(inputScore) { + FactorType factorType = StaticData::Instance().GetPlaceholderFactor(); + if (factorType != NOT_FOUND) { + for (size_t pos = 0; pos < m_phrase.size(); ++pos) { + if (m_phrase.GetFactor(pos, factorType)) { + m_placeholders.push_back(pos); + } + } + } } InputPath::~InputPath() diff --git a/moses/InputPath.h b/moses/InputPath.h index 53640df7c..87a3857f0 100644 --- a/moses/InputPath.h +++ b/moses/InputPath.h @@ -37,6 +37,7 @@ protected: // must clean up yourself. // used when pruning during placeholder processing std::vector m_copiedSet; + std::vector m_placeholders; public: explicit InputPath()