blob: d8db4ff9eb6dc499351795f01c31c1657fa4a8db (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#include "InputWeightFF.h"
#include <vector>
#include "moses/ScoreComponentCollection.h"
#include "moses/Syntax/SHyperedge.h"
#include "moses/TargetPhrase.h"
namespace Moses
{
namespace Syntax
{
InputWeightFF::InputWeightFF(const std::string &line)
: StatelessFeatureFunction(1, line)
{
ReadParameters();
}
void InputWeightFF::EvaluateWhenApplied(const Hypothesis& hypo,
ScoreComponentCollection* accumulator) const
{
// TODO Throw exception.
assert(false);
}
void InputWeightFF::EvaluateWhenApplied(const ChartHypothesis &hypo,
ScoreComponentCollection* accumulator) const
{
// TODO Throw exception.
assert(false);
}
void InputWeightFF::EvaluateWhenApplied(
const Syntax::SHyperedge &hyperedge,
ScoreComponentCollection* accumulator) const
{
accumulator->PlusEquals(this, hyperedge.label.inputWeight);
}
void InputWeightFF::SetParameter(const std::string& key,
const std::string& value)
{
StatelessFeatureFunction::SetParameter(key, value);
}
} // Syntax
} // Moses
|