#include <state.h>
| ZGen::ShiftReduce::StateItem::StateItem |
( |
| ) |
|
| ZGen::ShiftReduce::StateItem::StateItem |
( |
const dependency_t * |
ref | ) |
|
| void ZGen::ShiftReduce::StateItem::clear |
( |
| ) |
|
| void ZGen::ShiftReduce::StateItem::copy |
( |
const StateItem & |
other | ) |
|
Copy other state into the current state.
- Parameters
-
| [in] | other | The other state. |
| bool ZGen::ShiftReduce::StateItem::left_arc |
( |
deprel_t |
deprel | ) |
|
Perform left arc on current state, result in a new state on itself.
- Parameters
-
| [in] | deprel | The dependency relation. |
- Returns
- bool If successfully performed action, return true; Otherwise false.
| bool ZGen::ShiftReduce::StateItem::left_arc |
( |
deprel_t |
deprel, |
|
|
StateItem * |
other |
|
) |
| const |
An output wrapper for left arc by performing left arc and result in a new state.
| bool ZGen::ShiftReduce::StateItem::operator< |
( |
const StateItem & |
other | ) |
const |
| bool ZGen::ShiftReduce::StateItem::operator> |
( |
const StateItem & |
other | ) |
const |
| bool ZGen::ShiftReduce::StateItem::right_arc |
( |
deprel_t |
deprel | ) |
|
Perform right arc on current state, result in a new state on itself.
- Parameters
-
| [in] | deprel | The dependency relation. |
- Returns
- bool If successfully performed action, return true; Otherwise false.
| bool ZGen::ShiftReduce::StateItem::right_arc |
( |
deprel_t |
deprel, |
|
|
StateItem * |
other |
|
) |
| const |
An output wrapper for right arc by performing left arc and result in a new state.
| void ZGen::ShiftReduce::StateItem::set_reference |
( |
const dependency_t * |
_ref | ) |
|
Set the sentence reference to the current StateItem, it won't check whether the reference is seted.
- Parameters
-
| [in] | _ref | The pointer to the sentence |
| bool ZGen::ShiftReduce::StateItem::shift |
( |
postag_t |
postag, |
|
|
word_t |
word, |
|
|
int |
word_id |
|
) |
| |
Perform shift on current state, result in a new state on itself.
- Parameters
-
| [in] | postag | The PoSTag (represented in integer). |
| [in] | word | The word (represented in integer). |
| [in] | word_id | The index of the word in this sentence. |
- Returns
- bool If successfully shift, return true. otherwise false.
Perform shift on current state and result in a new state.
- Parameters
-
| [in] | postag | The PoSTag (represented in integer). |
| [in] | word | The word (represented in integer). |
| [in] | word_id | The index of the word in this sentence. |
| [out] | other | The pointer to the output state. |
- Returns
- bool If successfully shift, return true, otherwise false
| std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const StateItem & |
item |
|
) |
| |
|
friend |
The word indices in buffer for current state.
The tree(deprels) for the current state.
The tree(heads) for the current status.
| action_t ZGen::ShiftReduce::StateItem::last_action |
The action that result in the current state.
CACHE: use to store the 2nd-left-most child.
CACHE: use to store the left most child for the word.
The number of left children.
The sum of left descendants.
The number of right children.
The sum of right descendants.
| std::vector< postag_t > ZGen::ShiftReduce::StateItem::postag_sequence |
The sequence of postags leading by the current state.
| const StateItem* ZGen::ShiftReduce::StateItem::previous |
The reference to the sentence.
The rank of the form, with word considered.
CACHE: use to store the 2nd-right-most child.
CACHE: use to store the right most child for the word.
| std::vector<int> ZGen::ShiftReduce::StateItem::stack |
The score for the current state.
The stack for the current state
| int ZGen::ShiftReduce::StateItem::top0 |
| int ZGen::ShiftReduce::StateItem::top1 |
The top word in the stack of the current state.
| std::vector< word_t > ZGen::ShiftReduce::StateItem::word_sequence |
The sequence of words leading by the current state.
The documentation for this class was generated from the following files: