summaryrefslogtreecommitdiff
path: root/decoder/ff.cc
blob: 6e276a5e41a81aa274345b72cf51dc168392a5cb (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
#include "ff.h"

#include "tdict.h"
#include "hg.h"

using namespace std;

FeatureFunction::~FeatureFunction() {}

void FeatureFunction::PrepareForInput(const SentenceMetadata&) {}

void FeatureFunction::FinalTraversalFeatures(const void* /* ant_state */,
                                             SparseVector<double>* /* features */) const {}

string FeatureFunction::usage_helper(std::string const& name,std::string const& params,std::string const& details,bool sp,bool sd) {
  string r=name;
  if (sp) {
    r+=": ";
    r+=params;
  }
  if (sd) {
    r+="\n";
    r+=details;
  }
  return r;
}

void FeatureFunction::FinalTraversalFeatures(const SentenceMetadata& /* smeta */,
                                      const HG::Edge& /* edge */,
                                      const void* residual_state,
                                      SparseVector<double>* final_features) const {
  FinalTraversalFeatures(residual_state,final_features);
}

void FeatureFunction::TraversalFeaturesImpl(const SentenceMetadata&,
                                        const Hypergraph::Edge&,
                                        const std::vector<const void*>&,
                                        SparseVector<double>*,
                                        SparseVector<double>*,
                                        void*) const {
  cerr << "TraversalFeaturesImpl not implemented - override it or TraversalFeaturesLog\n";
  abort();
}