diff --git a/contrib/other-builds/moses2/PhraseBased/TargetPhrases.cpp b/contrib/other-builds/moses2/PhraseBased/TargetPhrases.cpp index b11459202..cbc67ce3d 100644 --- a/contrib/other-builds/moses2/PhraseBased/TargetPhrases.cpp +++ b/contrib/other-builds/moses2/PhraseBased/TargetPhrases.cpp @@ -54,7 +54,7 @@ void TargetPhrases::SortAndPrune(size_t tableLimit) m_coll.end() : m_coll.begin() + tableLimit; std::partial_sort(m_coll.begin(), iterMiddle, m_coll.end(), - CompareFutureScore()); + CompareFutureScore()); if (tableLimit && m_coll.size() > tableLimit) { m_coll.resize(tableLimit); diff --git a/contrib/other-builds/moses2/PhraseBased/TargetPhrases.h b/contrib/other-builds/moses2/PhraseBased/TargetPhrases.h index 73bf886cc..5ad74b75d 100644 --- a/contrib/other-builds/moses2/PhraseBased/TargetPhrases.h +++ b/contrib/other-builds/moses2/PhraseBased/TargetPhrases.h @@ -19,7 +19,8 @@ class System; class TargetPhrases { - typedef Array*> Coll; + typedef TargetPhrase TP; + typedef Array Coll; public: typedef Coll::iterator iterator; typedef Coll::const_iterator const_iterator; @@ -37,7 +38,7 @@ public: //TargetPhrases(MemPool &pool, const System &system, const TargetPhrases ©); virtual ~TargetPhrases(); - void AddTargetPhrase(const TargetPhrase &targetPhrase) + void AddTargetPhrase(const TP &targetPhrase) { m_coll[m_currInd++] = &targetPhrase; } @@ -47,7 +48,7 @@ public: return m_coll.size(); } - const TargetPhrase& operator[](size_t ind) const + const TP& operator[](size_t ind) const { return *m_coll[ind]; } diff --git a/contrib/other-builds/moses2/TargetPhrase.h b/contrib/other-builds/moses2/TargetPhrase.h index d8ba24312..5c4f40a28 100644 --- a/contrib/other-builds/moses2/TargetPhrase.h +++ b/contrib/other-builds/moses2/TargetPhrase.h @@ -58,15 +58,15 @@ protected: }; /////////////////////////////////////////////////////////////////////// -template +template struct CompareFutureScore { - bool operator()(const TargetPhrase *a, const TargetPhrase *b) const + bool operator()(const TP *a, const TP *b) const { return a->GetFutureScore() > b->GetFutureScore(); } - bool operator()(const TargetPhrase &a, const TargetPhrase &b) const + bool operator()(const TP &a, const TP &b) const { return a.GetFutureScore() > b.GetFutureScore(); }