mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 13:23:25 +03:00
find placeholders
This commit is contained in:
parent
6088531dfe
commit
ea02ef6b6e
@ -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()
|
||||
|
@ -37,6 +37,7 @@ protected:
|
||||
// must clean up yourself.
|
||||
// used when pruning during placeholder processing
|
||||
std::vector<TargetPhraseCollection> m_copiedSet;
|
||||
std::vector<size_t> m_placeholders;
|
||||
|
||||
public:
|
||||
explicit InputPath()
|
||||
|
Loading…
Reference in New Issue
Block a user