-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.h
More file actions
70 lines (41 loc) · 1.04 KB
/
node.h
File metadata and controls
70 lines (41 loc) · 1.04 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef _NODE_H_
#define _NODE_H_
#include <utility>
using namespace std;
class AlignedNode {
public:
AlignedNode();
bool IsSetTag() const;
int GetTag() const;
void SetTag(int value);
bool IsSetWord() const;
int GetWord() const;
void SetWord(int value);
void UnsetWord();
int GetWordIndex() const;
void SetWordIndex(int value);
bool IsSplitNode() const;
void SetSplitNode(bool value);
pair<int, int> GetSpan() const;
void SetSpan(const pair<int, int>& span);
bool operator<(const AlignedNode& node) const;
bool operator!=(const AlignedNode& node) const;
private:
int tag, word, word_index;
int start, end;
bool split_node;
};
class StringNode {
public:
StringNode(int word, int word_index, int var_index);
bool IsSetWord() const;
int GetWord() const;
int GetWordIndex() const;
void SetWordIndex(int value);
int GetVarIndex() const;
bool operator<(const StringNode& node) const;
bool operator==(const StringNode& node) const;
private:
int word, word_index, var_index;
};
#endif