delete m_latticeSamplesCollector

This commit is contained in:
Hieu Hoang 2014-10-03 14:57:27 +01:00
parent 056913df57
commit 25db86d16b
3 changed files with 5 additions and 4 deletions

View File

@ -81,6 +81,8 @@ IOWrapper::IOWrapper(const std::vector<FactorType> &inputFactorOrder
,m_searchGraphOutputCollector(NULL)
,m_detailedTranslationCollector(NULL)
,m_wordGraphCollector(NULL)
,m_latticeSamplesCollector(NULL)
,m_surpressSingleBestOutput(false)
{
const StaticData &staticData = StaticData::Instance();
@ -187,6 +189,7 @@ IOWrapper::~IOWrapper()
delete m_searchGraphOutputCollector;
delete m_detailedTranslationCollector;
delete m_wordGraphCollector;
delete m_latticeSamplesCollector;
}
InputType*

View File

@ -21,7 +21,6 @@ TranslationTask::TranslationTask(size_t lineNumber, InputType* source, MosesCmd:
boost::shared_ptr<HypergraphOutput<Manager> > hypergraphOutput) :
m_source(source), m_lineNumber(lineNumber),
m_ioWrapper(ioWrapper),
m_latticeSamplesCollector(latticeSamplesCollector),
m_outputSearchGraphSLF(outputSearchGraphSLF),
m_hypergraphOutput(hypergraphOutput)
{}
@ -250,13 +249,13 @@ void TranslationTask::Run() {
}
//lattice samples
if (m_latticeSamplesCollector) {
if (m_ioWrapper.GetLatticeSamplesCollector()) {
TrellisPathList latticeSamples;
ostringstream out;
manager.CalcLatticeSamples(staticData.GetLatticeSamplesSize(), latticeSamples);
OutputNBest(out,latticeSamples, staticData.GetOutputFactorOrder(), m_lineNumber,
staticData.GetReportSegmentation());
m_latticeSamplesCollector->Write(m_lineNumber, out.str());
m_ioWrapper.GetLatticeSamplesCollector()->Write(m_lineNumber, out.str());
}
// detailed translation reporting

View File

@ -43,7 +43,6 @@ private:
size_t m_lineNumber;
MosesCmd::IOWrapper &m_ioWrapper;
Moses::OutputCollector* m_latticeSamplesCollector;
bool m_outputSearchGraphSLF;
boost::shared_ptr<Moses::HypergraphOutput<Moses::Manager> > m_hypergraphOutput;