mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-06 19:49:41 +03:00
66 lines
1.3 KiB
C++
66 lines
1.3 KiB
C++
/*
|
|
* TargetPhrase.h
|
|
*
|
|
* Created on: 23 Oct 2015
|
|
* Author: hieu
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <iostream>
|
|
#include "Phrase.h"
|
|
#include "MemPool.h"
|
|
|
|
namespace Moses2
|
|
{
|
|
|
|
class Scores;
|
|
class Manager;
|
|
class System;
|
|
|
|
class TargetPhrase : public PhraseImpl
|
|
{
|
|
friend std::ostream& operator<<(std::ostream &, const TargetPhrase &);
|
|
public:
|
|
mutable void **ffData;
|
|
SCORE *scoreProperties;
|
|
|
|
static TargetPhrase *CreateFromString(MemPool &pool, const System &system, const std::string &str);
|
|
TargetPhrase(MemPool &pool, const System &system, size_t size);
|
|
TargetPhrase(MemPool &pool, const System &system, const TargetPhrase ©);
|
|
|
|
virtual ~TargetPhrase();
|
|
|
|
Scores &GetScores()
|
|
{ return *m_scores; }
|
|
|
|
const Scores &GetScores() const
|
|
{ return *m_scores; }
|
|
|
|
SCORE GetFutureScore() const;
|
|
|
|
void SetEstimatedScore(const SCORE &value)
|
|
{ m_estimatedScore = value; }
|
|
|
|
SCORE *GetScoresProperty(int propertyInd) const;
|
|
protected:
|
|
Scores *m_scores;
|
|
SCORE m_estimatedScore;
|
|
};
|
|
|
|
//////////////////////////////////////////
|
|
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();
|
|
}
|
|
};
|
|
|
|
}
|
|
|