1 #ifndef __ZGEN_SHITREDUCE_TYPES_STATE_H__
2 #define __ZGEN_SHITREDUCE_TYPES_STATE_H__
13 namespace ShiftReduce {
65 std::bitset<kMaxNumberOfWords>
buffer;
172 #endif // end for __ZGEN_SHITREDUCE_TYPES_STATE_H__
int nr_right_children[kMaxNumberOfWords]
The number of right children.
Definition: state.h:83
std::vector< word_t > word_sequence
The sequence of words leading by the current state.
Definition: state.h:59
int deprels[kMaxNumberOfWords]
The tree(deprels) for the current state.
Definition: state.h:77
int right_most_child[kMaxNumberOfWords]
CACHE: use to store the right most child for the word.
Definition: state.h:95
int nr_right_descendant[kMaxNumberOfWords]
The sum of right descendants.
Definition: state.h:89
floatval_t score
The previous state.
Definition: state.h:53
const int kMaxNumberOfWords
Definition: settings.h:8
int postags[kMaxNumberOfWords]
The postags cache.
Definition: state.h:71
int word_t
Definition: instance.h:11
int heads[kMaxNumberOfWords]
The tree(heads) for the current status.
Definition: state.h:74
const dependency_t * ref
The second top word.
Definition: state.h:51
Definition: instance.h:18
StateItem()
Definition: state.cc:10
action_t last_action
The action that result in the current state.
Definition: state.h:104
std::vector< postag_t > postag_sequence
The sequence of postags leading by the current state.
Definition: state.h:62
int left_most_child[kMaxNumberOfWords]
CACHE: use to store the left most child for the word.
Definition: state.h:92
double floatval_t
Definition: settings.h:24
const StateItem * previous
The reference to the sentence.
Definition: state.h:52
void clear()
Definition: state.cc:53
friend std::ostream & operator<<(std::ostream &os, const StateItem &item)
Definition: state.cc:20
bool shift(postag_t postag, word_t word, int word_id)
Definition: state.cc:124
void set_reference(const dependency_t *_ref)
Definition: state.cc:47
bool operator>(const StateItem &other) const
greater than operator
Definition: state.cc:42
void copy(const StateItem &other)
Definition: state.cc:95
bool operator<(const StateItem &other) const
less than operator
Definition: state.cc:36
int deprel_t
Definition: instance.h:13
int postag_t
Definition: instance.h:12
std::vector< int > stack
The score for the current state.
Definition: state.h:56
int nr_left_children[kMaxNumberOfWords]
The number of left children.
Definition: state.h:80
int top1
The top word in the stack of the current state.
Definition: state.h:50
int left_2nd_most_child[kMaxNumberOfWords]
CACHE: use to store the 2nd-left-most child.
Definition: state.h:98
bool left_arc(deprel_t deprel)
Definition: state.cc:179
int nr_left_descendant[kMaxNumberOfWords]
The sum of left descendants.
Definition: state.h:86
int right_2nd_most_child[kMaxNumberOfWords]
CACHE: use to store the 2nd-right-most child.
Definition: state.h:101
std::bitset< kMaxNumberOfWords > buffer
The word indices in buffer for current state.
Definition: state.h:65
bool right_arc(deprel_t deprel)
Definition: state.cc:246
StateItem & operator=(const StateItem &item)
assign operator
Definition: state.cc:29
int top0
Definition: state.h:49
int rank[kMaxNumberOfWords]
The rank of the form, with word considered.
Definition: state.h:68