mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 05:14:36 +03:00
move OutputAlignment() to Manager class
This commit is contained in:
parent
e92c2c0e0c
commit
c9d49f22a5
@ -391,21 +391,6 @@ void IOWrapper::WriteApplicationContext(std::ostream &out,
|
||||
}
|
||||
}
|
||||
|
||||
void IOWrapper::OutputAlignment(OutputCollector* collector, size_t lineNo , const vector<const Hypothesis *> &edges)
|
||||
{
|
||||
ostringstream out;
|
||||
Hypothesis::OutputAlignment(out, edges);
|
||||
|
||||
collector->Write(lineNo,out.str());
|
||||
}
|
||||
|
||||
void IOWrapper::OutputAlignment(OutputCollector* collector, size_t lineNo , const TrellisPath &path)
|
||||
{
|
||||
if (collector) {
|
||||
OutputAlignment(collector,lineNo, path.GetEdges());
|
||||
}
|
||||
}
|
||||
|
||||
void IOWrapper::Backtrack(const Hypothesis *hypo)
|
||||
{
|
||||
|
||||
|
@ -166,8 +166,6 @@ public:
|
||||
// CHART
|
||||
|
||||
// phrase-based
|
||||
void OutputAlignment(Moses::OutputCollector* collector, size_t lineNo, const Moses::TrellisPath &path);
|
||||
void OutputAlignment(OutputCollector* collector, size_t lineNo , const std::vector<const Hypothesis *> &edges);
|
||||
|
||||
// post editing
|
||||
std::ifstream *spe_src, *spe_trg, *spe_aln;
|
||||
|
@ -1875,4 +1875,19 @@ void Manager::OutputBestHypo(const Moses::TrellisPath &path, long /*translationI
|
||||
out << endl;
|
||||
}
|
||||
|
||||
void Manager::OutputAlignment(OutputCollector* collector, size_t lineNo , const vector<const Hypothesis *> &edges)
|
||||
{
|
||||
ostringstream out;
|
||||
Hypothesis::OutputAlignment(out, edges);
|
||||
|
||||
collector->Write(lineNo,out.str());
|
||||
}
|
||||
|
||||
void Manager::OutputAlignment(OutputCollector* collector, size_t lineNo , const TrellisPath &path)
|
||||
{
|
||||
if (collector) {
|
||||
OutputAlignment(collector,lineNo, path.GetEdges());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -167,6 +167,9 @@ public:
|
||||
char reportSegmentation, bool reportAllFactors, std::ostream& out) const;
|
||||
void OutputBestHypo(const Moses::TrellisPath &path, long /*translationId*/,char reportSegmentation, bool reportAllFactors, std::ostream &out) const;
|
||||
|
||||
void OutputAlignment(Moses::OutputCollector* collector, size_t lineNo, const Moses::TrellisPath &path);
|
||||
void OutputAlignment(OutputCollector* collector, size_t lineNo , const std::vector<const Hypothesis *> &edges);
|
||||
|
||||
#ifdef HAVE_PROTOBUF
|
||||
void SerializeSearchGraphPB(long translationId, std::ostream& outputStream) const;
|
||||
#endif
|
||||
|
@ -193,7 +193,7 @@ void TranslationTask::RunPb()
|
||||
manager.OutputBestHypo(conBestHypo, m_source->GetTranslationId(),
|
||||
staticData.GetReportSegmentation(),
|
||||
staticData.GetReportAllFactors(),out);
|
||||
m_ioWrapper.OutputAlignment(m_ioWrapper.GetAlignmentInfoCollector(), m_source->GetTranslationId(), conBestHypo);
|
||||
manager.OutputAlignment(m_ioWrapper.GetAlignmentInfoCollector(), m_source->GetTranslationId(), conBestHypo);
|
||||
IFVERBOSE(2) {
|
||||
PrintUserTime("finished Consensus decoding");
|
||||
}
|
||||
@ -205,7 +205,7 @@ void TranslationTask::RunPb()
|
||||
manager.OutputBestHypo(mbrBestHypo, m_source->GetTranslationId(),
|
||||
staticData.GetReportSegmentation(),
|
||||
staticData.GetReportAllFactors(),out);
|
||||
m_ioWrapper.OutputAlignment(m_ioWrapper.GetAlignmentInfoCollector(), m_source->GetTranslationId(), mbrBestHypo);
|
||||
manager.OutputAlignment(m_ioWrapper.GetAlignmentInfoCollector(), m_source->GetTranslationId(), mbrBestHypo);
|
||||
IFVERBOSE(2) {
|
||||
PrintUserTime("finished MBR decoding");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user