summaryrefslogtreecommitdiff
path: root/decoder/ff_external.h
blob: 3e2bee516ec316fee16bac82154b7b73dd2c5451 (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
#ifndef _FFEXTERNAL_H_
#define _FFEXTERNAL_H_

#include "ff.h"

// dynamically loaded feature function
class ExternalFeature : public FeatureFunction {
 public:
  ExternalFeature(const std::string& param);
  ~ExternalFeature();
  virtual void PrepareForInput(const SentenceMetadata& smeta);
  virtual void FinalTraversalFeatures(const void* context,
                                      SparseVector<double>* features) const;
 protected:
  virtual void TraversalFeaturesImpl(const SentenceMetadata& smeta,
                                     const HG::Edge& edge,
                                     const std::vector<const void*>& ant_contexts,
                                     SparseVector<double>* features,
                                     SparseVector<double>* estimated_features,
                                     void* context) const;
 private:
  void* lib_handle;
  FeatureFunction* ff_ext;
};

#endif