diff --git a/moses/LatticeMBR.cpp b/moses/LatticeMBR.cpp index 9ea21d5db..b6fa14757 100644 --- a/moses/LatticeMBR.cpp +++ b/moses/LatticeMBR.cpp @@ -499,7 +499,7 @@ bool ascendingCoverageCmp(const Hypothesis* a, const Hypothesis* b) return a->GetWordsBitmap().GetNumWordsCovered() < b->GetWordsBitmap().GetNumWordsCovered(); } -void getLatticeMBRNBest(Manager& manager, TrellisPathList& nBestList, +void getLatticeMBRNBest(const Manager& manager, const TrellisPathList& nBestList, vector& solutions, size_t n) { const StaticData& staticData = StaticData::Instance(); @@ -546,7 +546,7 @@ void getLatticeMBRNBest(Manager& manager, TrellisPathList& nBestList, VERBOSE(2,"LMBR Score: " << solutions[0].GetScore() << endl); } -vector doLatticeMBR(Manager& manager, TrellisPathList& nBestList) +vector doLatticeMBR(const Manager& manager, const TrellisPathList& nBestList) { vector solutions; @@ -554,7 +554,7 @@ vector doLatticeMBR(Manager& manager, TrellisPathList& nBestList) return solutions.at(0).GetWords(); } -const TrellisPath doConsensusDecoding(Manager& manager, TrellisPathList& nBestList) +const TrellisPath doConsensusDecoding(const Manager& manager, const TrellisPathList& nBestList) { static const int BLEU_ORDER = 4; static const float SMOOTH = 1; diff --git a/moses/LatticeMBR.h b/moses/LatticeMBR.h index 47d6da3c4..5fa47949d 100644 --- a/moses/LatticeMBR.h +++ b/moses/LatticeMBR.h @@ -137,15 +137,15 @@ void pruneLatticeFB(Lattice & connectedHyp, std::map < const Moses::Hypothesis*, const std::vector< float> & estimatedScores, const Moses::Hypothesis*, size_t edgeDensity,float scale); //Use the ngram scores to rerank the nbest list, return at most n solutions -void getLatticeMBRNBest(Moses::Manager& manager, Moses::TrellisPathList& nBestList, std::vector& solutions, size_t n); +void getLatticeMBRNBest(const Moses::Manager& manager, const Moses::TrellisPathList& nBestList, std::vector& solutions, size_t n); //calculate expectated ngram counts, clipping at 1 (ie calculating posteriors) if posteriors==true. void calcNgramExpectations(Lattice & connectedHyp, std::map >& incomingEdges, std::map& finalNgramScores, bool posteriors); void GetOutputFactors(const Moses::TrellisPath &path, std::vector &translation); void extract_ngrams(const std::vector& sentence, std::map < Moses::Phrase, int > & allngrams); bool ascendingCoverageCmp(const Moses::Hypothesis* a, const Moses::Hypothesis* b); -std::vector doLatticeMBR(Moses::Manager& manager, Moses::TrellisPathList& nBestList); -const Moses::TrellisPath doConsensusDecoding(Moses::Manager& manager, Moses::TrellisPathList& nBestList); +std::vector doLatticeMBR(const Moses::Manager& manager, const Moses::TrellisPathList& nBestList); +const Moses::TrellisPath doConsensusDecoding(const Moses::Manager& manager, const Moses::TrellisPathList& nBestList); //std::vector doConsensusDecoding(Moses::Manager& manager, Moses::TrellisPathList& nBestList); }