diff --git a/moses-cmd/LatticeMBRGrid.cpp b/moses-cmd/LatticeMBRGrid.cpp index 9b2ee167c..17596cbdb 100644 --- a/moses-cmd/LatticeMBRGrid.cpp +++ b/moses-cmd/LatticeMBRGrid.cpp @@ -200,7 +200,7 @@ int main(int argc, char* argv[]) staticData.SetMBRScale(scale); cout << lineCount << " ||| " << p << " " << r << " " << prune << " " << scale << " ||| "; vector mbrBestHypo = doLatticeMBR(manager,nBestList); - ioWrapper->OutputBestHypo(mbrBestHypo, lineCount, staticData.GetReportSegmentation(), + manager.OutputBestHypo(mbrBestHypo, lineCount, staticData.GetReportSegmentation(), staticData.GetReportAllFactors(),cout); } } diff --git a/moses/Manager.cpp b/moses/Manager.cpp index a86a1437b..ebd204e97 100644 --- a/moses/Manager.cpp +++ b/moses/Manager.cpp @@ -1827,7 +1827,7 @@ void Manager::OutputSearchGraphHypergraph() const } } -void Manager::OutputLatticeMBRNBest(std::ostream& out, const vector& solutions,long translationId) +void Manager::OutputLatticeMBRNBest(std::ostream& out, const vector& solutions,long translationId) const { for (vector::const_iterator si = solutions.begin(); si != solutions.end(); ++si) { out << translationId; @@ -1851,7 +1851,7 @@ void Manager::OutputLatticeMBRNBest(std::ostream& out, const vector& mbrBestHypo, long /*translationId*/, char /*reportSegmentation*/, bool /*reportAllFactors*/, ostream& out) +void Manager::OutputBestHypo(const std::vector& mbrBestHypo, long /*translationId*/, char /*reportSegmentation*/, bool /*reportAllFactors*/, ostream& out) const { for (size_t i = 0 ; i < mbrBestHypo.size() ; i++) { diff --git a/moses/Manager.h b/moses/Manager.h index 9962d8e29..2cbf474f0 100644 --- a/moses/Manager.h +++ b/moses/Manager.h @@ -162,9 +162,9 @@ public: void GetWordGraph(long translationId, std::ostream &outputWordGraphStream) const; int GetNextHypoId(); - static void OutputLatticeMBRNBest(std::ostream& out, const std::vector& solutions,long translationId); - static void OutputBestHypo(const std::vector& mbrBestHypo, long /*translationId*/, - char reportSegmentation, bool reportAllFactors, std::ostream& out); + void OutputLatticeMBRNBest(std::ostream& out, const std::vector& solutions,long translationId) const; + void OutputBestHypo(const std::vector& mbrBestHypo, long /*translationId*/, + char reportSegmentation, bool reportAllFactors, std::ostream& out) const; #ifdef HAVE_PROTOBUF void SerializeSearchGraphPB(long translationId, std::ostream& outputStream) const; diff --git a/moses/TranslationTask.cpp b/moses/TranslationTask.cpp index 8d52789fc..999c05368 100644 --- a/moses/TranslationTask.cpp +++ b/moses/TranslationTask.cpp @@ -174,12 +174,12 @@ void TranslationTask::RunPb() size_t n = min(nBestSize, staticData.GetNBestSize()); getLatticeMBRNBest(manager,nBestList,solutions,n); ostringstream out; - Manager::OutputLatticeMBRNBest(out, solutions, m_source->GetTranslationId()); + manager.OutputLatticeMBRNBest(out, solutions, m_source->GetTranslationId()); m_ioWrapper.GetNBestOutputCollector()->Write(m_source->GetTranslationId(), out.str()); } else { //Lattice MBR decoding vector mbrBestHypo = doLatticeMBR(manager,nBestList); - Manager::OutputBestHypo(mbrBestHypo, m_source->GetTranslationId(), staticData.GetReportSegmentation(), + manager.OutputBestHypo(mbrBestHypo, m_source->GetTranslationId(), staticData.GetReportSegmentation(), staticData.GetReportAllFactors(),out); IFVERBOSE(2) { PrintUserTime("finished Lattice MBR decoding");