From aaa3f24109c13d4b8ee6f0211a7302f9ae2d76e4 Mon Sep 17 00:00:00 2001 From: Hieu Hoang Date: Wed, 27 Apr 2016 23:30:24 +0100 Subject: [PATCH] debugging method for source phrase --- contrib/other-builds/moses2/Phrase.h | 9 ++++----- .../moses2/TranslationModel/Memory/PhraseTableMemory.cpp | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/contrib/other-builds/moses2/Phrase.h b/contrib/other-builds/moses2/Phrase.h index 4364c9aea..b18d37673 100644 --- a/contrib/other-builds/moses2/Phrase.h +++ b/contrib/other-builds/moses2/Phrase.h @@ -14,6 +14,7 @@ #include "MemPool.h" #include "TypeDef.h" #include "legacy/FactorCollection.h" +#include "SCFG/Word.h" namespace Moses2 { @@ -120,20 +121,18 @@ inline std::ostream& operator<<(std::ostream &out, const Phrase &o } return out; } -/* -template -inline std::ostream& operator<<(std::ostream &out, const Phrase &obj) + +inline std::ostream& operator<<(std::ostream &out, const Phrase &obj) { if (obj.GetSize()) { out << obj[0]; for (size_t i = 1; i < obj.GetSize(); ++i) { - const WORD &word = obj[i]; + const SCFG::Word &word = obj[i]; out << " " << word; } } return out; } -*/ //////////////////////////////////////////////////////////////////////// template diff --git a/contrib/other-builds/moses2/TranslationModel/Memory/PhraseTableMemory.cpp b/contrib/other-builds/moses2/TranslationModel/Memory/PhraseTableMemory.cpp index 4b4c6e97f..737cbe832 100644 --- a/contrib/other-builds/moses2/TranslationModel/Memory/PhraseTableMemory.cpp +++ b/contrib/other-builds/moses2/TranslationModel/Memory/PhraseTableMemory.cpp @@ -95,7 +95,7 @@ void PhraseTableMemory::Load(System &system) SCFG::TargetPhraseImpl *target = SCFG::TargetPhraseImpl::CreateFromString(systemPool, *this, system, toks[1]); target->SetAlignmentInfo(toks[3]); - cerr << "created target " << *target << endl; + //cerr << "created target " << *target << " source=" << *source << endl; target->GetScores().CreateFromString(toks[2], *this, system, true); //cerr << "created scores:" << *target << endl;