DeSR Dependency Parser |
#include <State.h>
Public Member Functions | |
State (Sentence const &sentence, GlobalInfo *globalInfo) | |
Constructor. | |
State (State const &state) | |
bool | hasNext () |
State * | transition (Action action) |
Perform action represented by Action action . | |
State * | Shift () |
Parsing actions. | |
State * | Right (Action action) |
State * | Left (Action action) |
State * | right (Action action) |
State * | left (char const *action) |
State * | DepLink (Action action) |
State * | Extract () |
State * | Insert () |
Sentence * | getSentence () |
void | showStatus () |
Public Attributes | |
Sentence | sentence |
The current sentence. | |
TreeToken * | rootNode |
Dummy root node. | |
std::string | splitFeature |
used to split SVMs | |
Static Public Attributes | |
static Tanl::Text::RegExp::Pattern | ispunct |
Pattern for detecting punctuation:. | |
Protected Member Functions | |
virtual TreeToken * | copy (TreeToken *x) |
void | predicates (Features &preds, Action action=0) |
Collect features representing context. | |
Protected Attributes | |
SentenceInfo * | sentenceInfo |
std::vector< TreeToken * > | input |
Stack from which input tokens are extracted. | |
std::vector< TreeToken * > | stack |
Stack where analyzed tokens are accumulated. | |
std::vector< TreeToken * > | extracted |
Stack where extracted tokens are accumulated. | |
State const * | previous |
The previous State in the derivation. | |
Action | action |
The action that lead to this state. | |
int | verbCount |
Number of verbs so far. | |
Static Protected Attributes | |
static Tanl::Text::RegExp::Pattern | nonWordAscii |
Weird version of ispunct. |
Definition at line 72 of file State.h.
Parser::State::State | ( | Sentence const & | sentence, | |
GlobalInfo * | globalInfo | |||
) |
bool Parser::State::hasNext | ( | ) |
Reimplemented in Parser::TrainState, and Parser::ParseState.
Definition at line 138 of file State.cpp.
References input.
State * Parser::State::transition | ( | Action | action | ) |
Perform action represented by Action action
.
Perform a parsing action.
The reduce actions (Left/Right) are combined with the deprel to be assigned to the link created. If CompositeAction is false, instead, there are separate additional actions DepLeft and DepRight, used to assign the label to a link created with the preceding reduce action. DepLeft and DepRight are paired with the dependency label to be assigned.
Reimplemented in Parser::ParseState.
Definition at line 336 of file State.cpp.
References input, Shift(), and stack.
Referenced by Parser::EventStream::next(), and Parser::ParseState::transition().