Moved duplicate struct CompareTargetPhrase to TargetPhraseCollection.{h|cpp}

This commit is contained in:
= 2013-09-25 00:07:18 +01:00
parent 61dacaa9bd
commit 794770e696
2 changed files with 20 additions and 5 deletions

View File

@ -28,11 +28,20 @@ using namespace std;
namespace Moses
{
// helper for sort
struct CompareTargetPhrase {
bool operator() (const TargetPhrase *a, const TargetPhrase *b) {
return a->GetFutureScore() > b->GetFutureScore();
}
};
bool
CompareTargetPhrase::
operator() (const TargetPhrase *a, const TargetPhrase *b) const
{
return a->GetFutureScore() > b->GetFutureScore();
}
bool
CompareTargetPhrase::
operator() (const TargetPhrase &a, const TargetPhrase &b) const
{
return a.GetFutureScore() > b.GetFutureScore();
}
TargetPhraseCollection::TargetPhraseCollection(const TargetPhraseCollection &copy)
{

View File

@ -118,6 +118,12 @@ public:
void Add(TargetPhrase *targetPhrase, const Phrase &sourcePhrase);
};
struct CompareTargetPhrase
{
bool operator() (const TargetPhrase *a, const TargetPhrase *b) const;
bool operator() (const TargetPhrase &a, const TargetPhrase &b) const;
};
}
#endif