figure out which feature function to apply at which decode step. Book-keeping

This commit is contained in:
Hieu Hoang 2013-05-30 21:12:36 +01:00
parent 7279164c8a
commit f9d6528088
3 changed files with 7 additions and 26 deletions

View File

@ -903,7 +903,6 @@ bool StaticData::LoadDecodeGraphs()
m_decodeGraphs.push_back(decodeGraph); // TODO max chart span
featuresRemaining = &FeatureFunction::GetFeatureFunctions();
}
m_decodeGraphs[decodeGraphInd]->Add(decodeStep);

View File

@ -167,28 +167,6 @@ void TargetPhrase::SetInputScore(const Scores &scoreVector)
m_scoreBreakdown.Assign(prod, sizedScoreVector);
}
TargetPhrase *TargetPhrase::MergeNext(const TargetPhrase &inputPhrase) const
{
if (! IsCompatible(inputPhrase)) {
return NULL;
}
// ok, merge
TargetPhrase *clone = new TargetPhrase(*this);
clone->m_sourcePhrase = m_sourcePhrase;
int currWord = 0;
const size_t len = GetSize();
for (size_t currPos = 0 ; currPos < len ; currPos++) {
const Word &inputWord = inputPhrase.GetWord(currPos);
Word &cloneWord = clone->GetWord(currPos);
cloneWord.Merge(inputWord);
currWord++;
}
return clone;
}
void TargetPhrase::SetAlignmentInfo(const StringPiece &alignString)
{
AlignmentInfo::CollType alignTerm, alignNonTerm;
@ -233,6 +211,12 @@ void TargetPhrase::SetSparseScore(const FeatureFunction* translationScoreProduce
m_scoreBreakdown.Assign(translationScoreProducer, sparseString.as_string());
}
void TargetPhrase::Merge(const TargetPhrase &copy, const std::vector<FactorType>& factorVec)
{
Phrase::MergeFactors(copy, factorVec);
m_scoreBreakdown.Merge(copy.GetScoreBreakdown());
}
TO_STRING_BODY(TargetPhrase);
std::ostream& operator<<(std::ostream& os, const TargetPhrase& tp)

View File

@ -71,9 +71,6 @@ public:
void SetXMLScore(float score);
void SetInputScore(const Scores &scoreVector);
TargetPhrase *MergeNext(const TargetPhrase &targetPhrase) const;
// used for translation step
#ifdef HAVE_PROTOBUF
void WriteToRulePB(hgmert::Rule* pb) const;
#endif
@ -128,6 +125,7 @@ public:
return *m_alignNonTerm;
}
void Merge(const TargetPhrase &copy, const std::vector<FactorType>& factorVec);
TO_STRING();
};