mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-10-26 11:28:48 +03:00
Moved duplicate struct CompareTargetPhrase to TargetPhraseCollection.{h|cpp}
This commit is contained in:
parent
61dacaa9bd
commit
794770e696
@ -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 ©)
|
||||
{
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user