mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 19:27:11 +03:00
convert static methods to const methods
This commit is contained in:
parent
5ac3dddfb6
commit
b82c31f020
@ -200,7 +200,7 @@ int main(int argc, char* argv[])
|
|||||||
staticData.SetMBRScale(scale);
|
staticData.SetMBRScale(scale);
|
||||||
cout << lineCount << " ||| " << p << " " << r << " " << prune << " " << scale << " ||| ";
|
cout << lineCount << " ||| " << p << " " << r << " " << prune << " " << scale << " ||| ";
|
||||||
vector<Word> mbrBestHypo = doLatticeMBR(manager,nBestList);
|
vector<Word> mbrBestHypo = doLatticeMBR(manager,nBestList);
|
||||||
ioWrapper->OutputBestHypo(mbrBestHypo, lineCount, staticData.GetReportSegmentation(),
|
manager.OutputBestHypo(mbrBestHypo, lineCount, staticData.GetReportSegmentation(),
|
||||||
staticData.GetReportAllFactors(),cout);
|
staticData.GetReportAllFactors(),cout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1827,7 +1827,7 @@ void Manager::OutputSearchGraphHypergraph() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Manager::OutputLatticeMBRNBest(std::ostream& out, const vector<LatticeMBRSolution>& solutions,long translationId)
|
void Manager::OutputLatticeMBRNBest(std::ostream& out, const vector<LatticeMBRSolution>& solutions,long translationId) const
|
||||||
{
|
{
|
||||||
for (vector<LatticeMBRSolution>::const_iterator si = solutions.begin(); si != solutions.end(); ++si) {
|
for (vector<LatticeMBRSolution>::const_iterator si = solutions.begin(); si != solutions.end(); ++si) {
|
||||||
out << translationId;
|
out << translationId;
|
||||||
@ -1851,7 +1851,7 @@ void Manager::OutputLatticeMBRNBest(std::ostream& out, const vector<LatticeMBRSo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Manager::OutputBestHypo(const std::vector<Word>& mbrBestHypo, long /*translationId*/, char /*reportSegmentation*/, bool /*reportAllFactors*/, ostream& out)
|
void Manager::OutputBestHypo(const std::vector<Word>& mbrBestHypo, long /*translationId*/, char /*reportSegmentation*/, bool /*reportAllFactors*/, ostream& out) const
|
||||||
{
|
{
|
||||||
|
|
||||||
for (size_t i = 0 ; i < mbrBestHypo.size() ; i++) {
|
for (size_t i = 0 ; i < mbrBestHypo.size() ; i++) {
|
||||||
|
@ -162,9 +162,9 @@ public:
|
|||||||
void GetWordGraph(long translationId, std::ostream &outputWordGraphStream) const;
|
void GetWordGraph(long translationId, std::ostream &outputWordGraphStream) const;
|
||||||
int GetNextHypoId();
|
int GetNextHypoId();
|
||||||
|
|
||||||
static void OutputLatticeMBRNBest(std::ostream& out, const std::vector<LatticeMBRSolution>& solutions,long translationId);
|
void OutputLatticeMBRNBest(std::ostream& out, const std::vector<LatticeMBRSolution>& solutions,long translationId) const;
|
||||||
static void OutputBestHypo(const std::vector<Moses::Word>& mbrBestHypo, long /*translationId*/,
|
void OutputBestHypo(const std::vector<Moses::Word>& mbrBestHypo, long /*translationId*/,
|
||||||
char reportSegmentation, bool reportAllFactors, std::ostream& out);
|
char reportSegmentation, bool reportAllFactors, std::ostream& out) const;
|
||||||
|
|
||||||
#ifdef HAVE_PROTOBUF
|
#ifdef HAVE_PROTOBUF
|
||||||
void SerializeSearchGraphPB(long translationId, std::ostream& outputStream) const;
|
void SerializeSearchGraphPB(long translationId, std::ostream& outputStream) const;
|
||||||
|
@ -174,12 +174,12 @@ void TranslationTask::RunPb()
|
|||||||
size_t n = min(nBestSize, staticData.GetNBestSize());
|
size_t n = min(nBestSize, staticData.GetNBestSize());
|
||||||
getLatticeMBRNBest(manager,nBestList,solutions,n);
|
getLatticeMBRNBest(manager,nBestList,solutions,n);
|
||||||
ostringstream out;
|
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());
|
m_ioWrapper.GetNBestOutputCollector()->Write(m_source->GetTranslationId(), out.str());
|
||||||
} else {
|
} else {
|
||||||
//Lattice MBR decoding
|
//Lattice MBR decoding
|
||||||
vector<Word> mbrBestHypo = doLatticeMBR(manager,nBestList);
|
vector<Word> mbrBestHypo = doLatticeMBR(manager,nBestList);
|
||||||
Manager::OutputBestHypo(mbrBestHypo, m_source->GetTranslationId(), staticData.GetReportSegmentation(),
|
manager.OutputBestHypo(mbrBestHypo, m_source->GetTranslationId(), staticData.GetReportSegmentation(),
|
||||||
staticData.GetReportAllFactors(),out);
|
staticData.GetReportAllFactors(),out);
|
||||||
IFVERBOSE(2) {
|
IFVERBOSE(2) {
|
||||||
PrintUserTime("finished Lattice MBR decoding");
|
PrintUserTime("finished Lattice MBR decoding");
|
||||||
|
Loading…
Reference in New Issue
Block a user