mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-11-10 10:59:21 +03:00
55 lines
1.6 KiB
C++
55 lines
1.6 KiB
C++
#include <vector>
|
|
#include "SyntaxRHS.h"
|
|
#include "moses/ScoreComponentCollection.h"
|
|
#include "moses/TargetPhrase.h"
|
|
#include "moses/StackVec.h"
|
|
|
|
using namespace std;
|
|
|
|
namespace Moses
|
|
{
|
|
SyntaxRHS::SyntaxRHS(const std::string &line)
|
|
:StatelessFeatureFunction(1, line)
|
|
{
|
|
ReadParameters();
|
|
}
|
|
|
|
void SyntaxRHS::EvaluateInIsolation(const Phrase &source
|
|
, const TargetPhrase &targetPhrase
|
|
, ScoreComponentCollection &scoreBreakdown
|
|
, ScoreComponentCollection &estimatedFutureScore) const
|
|
{
|
|
}
|
|
|
|
void SyntaxRHS::EvaluateWithSourceContext(const InputType &input
|
|
, const InputPath &inputPath
|
|
, const TargetPhrase &targetPhrase
|
|
, const StackVec *stackVec
|
|
, ScoreComponentCollection &scoreBreakdown
|
|
, ScoreComponentCollection *estimatedFutureScore) const
|
|
{
|
|
assert(stackVec);
|
|
for (size_t i = 0; i < stackVec->size(); ++i) {
|
|
const ChartCellLabel &cell = *stackVec->at(i);
|
|
|
|
}
|
|
|
|
if (targetPhrase.GetNumNonTerminals()) {
|
|
vector<float> newScores(m_numScoreComponents);
|
|
newScores[0] = - std::numeric_limits<float>::infinity();
|
|
scoreBreakdown.PlusEquals(this, newScores);
|
|
}
|
|
|
|
}
|
|
|
|
void SyntaxRHS::EvaluateWhenApplied(const Hypothesis& hypo,
|
|
ScoreComponentCollection* accumulator) const
|
|
{}
|
|
|
|
void SyntaxRHS::EvaluateWhenApplied(const ChartHypothesis &hypo,
|
|
ScoreComponentCollection* accumulator) const
|
|
{}
|
|
|
|
}
|
|
|