ZGen  0.2.0
a linearization system for natural language.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pipe.h
Go to the documentation of this file.
1 #ifndef __ZGEN_SHIFTREDUCE_PIPE_PIPE_H__
2 #define __ZGEN_SHIFTREDUCE_PIPE_PIPE_H__
3 
4 #include "settings.h"
5 #include "types/instance.h"
7 #include "shiftreduce/option.h"
15 
16 namespace ZGen {
17 
18 namespace ShiftReduce {
19 
20 // The basic pipe class
21 class Pipe {
22 public:
23 
24  Pipe(const option_t& opts);
25 
26 
27  virtual ~Pipe();
28 
35  bool save_model();
36 
43  bool load_model();
44 
51  bool realize();
52 private:
53 
59  void build_output(const StateItem& item,
60  const dependency_t& input,
61  dependency_t* output);
62 
63 private:
64  const option_t& opts; /*< The options */
66  int timestamp;
68  DecodeContext* ctx;
70  Decoder* decoder;
72  Learner* learner;
74  Model* model;
76  Knowledge::PostagConstrain* constrain;
77 private:
78  std::vector<dependency_t> dataset;
79  std::vector<dependency_t> referset;
80 };
81 
82 }
83 
84 }
85 #endif // end for __ZGEN_SHIFTREDUCE_PIPE_PIPE_H__
bool realize()
Definition: pipe.cc:91
Definition: state.h:15
Definition: option.h:10
Definition: model.h:12
Definition: learner.h:12
Definition: instance.h:18
Definition: postag_constrain.h:14
Definition: decoder.h:15
Used to maintain the memory cache used by the decoder.
Definition: decode_context.h:9
Pipe(const option_t &opts)
Definition: pipe.cc:17
virtual ~Pipe()
Definition: pipe.cc:50
Definition: pipe.h:21