ZGen  0.2.0
a linearization system for natural language.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
span_utils.h
Go to the documentation of this file.
1 #ifndef __ZGEN_BESTFIRST_SEARCH_SPAN_UTILS_H__
2 #define __ZGEN_BESTFIRST_SEARCH_SPAN_UTILS_H__
3 
4 #include <iostream>
5 #include "settings.h"
7 
8 namespace ZGen {
9 
10 namespace BestFirst {
11 
12 class SpanUtils {
13 public:
14  typedef std::pair<int, int> relation_t;
15 
22  static void get_all_relations(const Span* span,
23  std::vector<relation_t>& relations);
24 
31  static void get_all_left_relations(const Span* span,
32  std::vector<relation_t>& relations);
33 
40  static void get_all_right_relations(const Span* span,
41  std::vector<relation_t>& relations);
42 
49  static void get_all_modifier_words(const Span* span,
50  std::vector<word_t>& modifying_words);
51 
57  static void get_all_linearized_indices(const Span* span,
58  std::vector<int>& indices);
59 
66  static void get_all_modifier_postags(const Span* span,
67  std::vector<postag_t>& modifying_postags);
68 
75  static void get_all_linearized_words(const Span* span,
76  std::vector<word_t>& words);
77 
84  static void get_all_linearized_postags(const Span* span,
85  std::vector<postag_t>& postags);
86 private:
94  static void get_all_relations_travel(const Span* now,
95  std::vector<relation_t>& relations);
96 
103  static void get_all_left_relations_travel(const Span* span,
104  std::vector<relation_t>& relations);
105 
112  static void get_all_right_relations_travel(const Span* span,
113  std::vector<relation_t>& relations);
114 
121  static void get_all_linearized_indices_travel(const Span* now,
122  std::vector<int>& indices);
123 };
124 
125 } // end for namespace BestFirst
126 } // end for namespace ZGen
127 
128 #endif // end for __ZGEN_BESTFIRST_SEARCH_SPAN_UTILS_H__
static void get_all_modifier_words(const Span *span, std::vector< word_t > &modifying_words)
Definition: span_utils.cc:84
static void get_all_left_relations(const Span *span, std::vector< relation_t > &relations)
Definition: span_utils.cc:36
static void get_all_linearized_indices(const Span *span, std::vector< int > &indices)
Definition: span_utils.cc:118
std::pair< int, int > relation_t
Definition: span_utils.h:14
static void get_all_modifier_postags(const Span *span, std::vector< postag_t > &modifying_postags)
Definition: span_utils.cc:102
static void get_all_linearized_postags(const Span *span, std::vector< postag_t > &postags)
Definition: span_utils.cc:157
static void get_all_right_relations(const Span *span, std::vector< relation_t > &relations)
Definition: span_utils.cc:60
static void get_all_relations(const Span *span, std::vector< relation_t > &relations)
Definition: span_utils.cc:8
static void get_all_linearized_words(const Span *span, std::vector< word_t > &words)
Definition: span_utils.cc:140
Definition: span.h:13
Definition: span_utils.h:12