get ready for placeholders

This commit is contained in:
Hieu Hoang 2016-08-26 11:04:22 +01:00
parent b6ae28ecb3
commit 94d2a1895a
3 changed files with 17 additions and 4 deletions

View File

@ -139,9 +139,9 @@ void Hypothesis::OutputToStream(std::ostream &out) const
}
//cerr << *this << endl;
if (GetTargetPhrase().GetSize()) {
const Phrase<Moses2::Word> &phrase = GetTargetPhrase();
phrase.OutputToStream(out);
const TargetPhrase<Moses2::Word> &tp = GetTargetPhrase();
if (tp.GetSize()) {
tp.OutputToStream(*this, out);
out << " ";
}

View File

@ -109,7 +109,7 @@ std::string TrellisPath::OutputTargetPhrase(const System &system) const
const TrellisNode &node = nodes[i];
const Hypothesis *hypo = static_cast<const Hypothesis*>(node.GetHypo());
//cerr << "hypo=" << hypo << " " << *hypo << endl;
hypo->GetTargetPhrase().OutputToStream(out);
hypo->GetTargetPhrase().OutputToStream(*hypo, out);
out << " ";
}
return out.str();

View File

@ -42,6 +42,19 @@ public:
SCORE *GetScoresProperty(int propertyInd) const
{ return scoreProperties ? scoreProperties + propertyInd : NULL; }
void OutputToStream(const Hypothesis &hypo, std::ostream &out) const
{
size_t size = PhraseImplTemplate<WORD>::GetSize();
if (size) {
(*this)[0].OutputToStream(out);
for (size_t i = 1; i < size; ++i) {
const WORD &word = (*this)[i];
out << " BOO:";
word.OutputToStream(out);
}
}
}
virtual std::string Debug(const System &system) const
{
std::stringstream out;