2015-10-23 22:53:36 +03:00
|
|
|
/*
|
|
|
|
* TargetPhrase.h
|
|
|
|
*
|
|
|
|
* Created on: 23 Oct 2015
|
|
|
|
* Author: hieu
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2015-10-26 19:32:47 +03:00
|
|
|
#include <iostream>
|
2015-10-23 22:53:36 +03:00
|
|
|
#include "Phrase.h"
|
2015-10-28 19:11:12 +03:00
|
|
|
#include "MemPool.h"
|
2015-10-23 22:53:36 +03:00
|
|
|
|
2015-12-10 23:49:30 +03:00
|
|
|
namespace Moses2
|
|
|
|
{
|
|
|
|
|
2015-10-23 22:53:36 +03:00
|
|
|
class Scores;
|
|
|
|
class Manager;
|
2015-10-26 00:20:55 +03:00
|
|
|
class System;
|
2015-10-23 22:53:36 +03:00
|
|
|
|
2015-11-03 17:20:10 +03:00
|
|
|
class TargetPhrase : public PhraseImpl
|
2015-10-23 22:53:36 +03:00
|
|
|
{
|
2015-10-26 19:32:47 +03:00
|
|
|
friend std::ostream& operator<<(std::ostream &, const TargetPhrase &);
|
2015-10-23 22:53:36 +03:00
|
|
|
public:
|
2015-12-17 20:08:49 +03:00
|
|
|
mutable void **ffData;
|
2015-12-28 23:07:47 +03:00
|
|
|
SCORE *scoreProperties;
|
2015-12-17 20:08:49 +03:00
|
|
|
|
2015-10-28 20:24:45 +03:00
|
|
|
static TargetPhrase *CreateFromString(MemPool &pool, const System &system, const std::string &str);
|
|
|
|
TargetPhrase(MemPool &pool, const System &system, size_t size);
|
2015-12-07 19:49:02 +03:00
|
|
|
TargetPhrase(MemPool &pool, const System &system, const TargetPhrase ©);
|
|
|
|
|
2015-10-24 04:02:50 +03:00
|
|
|
virtual ~TargetPhrase();
|
|
|
|
|
|
|
|
Scores &GetScores()
|
|
|
|
{ return *m_scores; }
|
2015-10-23 22:53:36 +03:00
|
|
|
|
2015-10-26 19:32:47 +03:00
|
|
|
const Scores &GetScores() const
|
|
|
|
{ return *m_scores; }
|
|
|
|
|
2015-11-03 08:39:27 +03:00
|
|
|
SCORE GetFutureScore() const;
|
|
|
|
|
|
|
|
void SetEstimatedScore(const SCORE &value)
|
|
|
|
{ m_estimatedScore = value; }
|
2015-11-02 18:39:01 +03:00
|
|
|
|
2015-12-28 23:07:47 +03:00
|
|
|
SCORE *GetScoresProperty(int propertyInd) const;
|
2015-10-23 22:53:36 +03:00
|
|
|
protected:
|
|
|
|
Scores *m_scores;
|
2015-11-03 08:39:27 +03:00
|
|
|
SCORE m_estimatedScore;
|
2015-10-23 22:53:36 +03:00
|
|
|
};
|
|
|
|
|
2015-11-06 13:55:04 +03:00
|
|
|
//////////////////////////////////////////
|
|
|
|
struct CompareFutureScore {
|
|
|
|
bool operator() (const TargetPhrase *a, const TargetPhrase *b) const
|
|
|
|
{
|
|
|
|
return a->GetFutureScore() > b->GetFutureScore();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator() (const TargetPhrase &a, const TargetPhrase &b) const
|
|
|
|
{
|
|
|
|
return a.GetFutureScore() > b.GetFutureScore();
|
|
|
|
}
|
|
|
|
};
|
2015-11-02 17:06:03 +03:00
|
|
|
|
2015-12-10 23:49:30 +03:00
|
|
|
}
|
|
|
|
|