DeSR Dependency Parser |
#include <Token.h>
Public Member Functions | |
TreeToken (std::string &form, AttributeIndex *ai) | |
TreeToken (int id, char const *form, AttributeIndex *attributeIndex=0) | |
TreeToken (int id, std::string &form, Attributes &attributes, TokenLinks &links) | |
TreeToken (int id, std::string &form, Attributes &attributes) | |
TreeToken (int id, Token *token) | |
TreeToken (TreeToken const &tok) | |
std::string const * | get (char const *key) const |
void | set (char const *key, char const *value) |
Add the attribute value associated to key key . | |
void | set (char const *key, std::string const &value) |
Add the attribute value associated to key key . | |
int | linkHead (unsigned i=0) const |
int | linkHead (int h, unsigned i=0) |
std::string const & | linkLabel (unsigned i=0) const |
std::string const & | linkLabel (std::string &l, unsigned i=0) |
std::string const & | linkLabel (char const *l, unsigned i=0) |
int | size () |
TreeToken * | follow (Parser::TokenPath const &tp, Sentence &sentence) |
Get the token following the given path tp , through sentence sentence . | |
int | leftmostDescendant () |
int | rightmostDescendant () |
TreeToken * | ancestorCPos (char const *pos, Sentence &sent) |
TreeToken * | descendantCPos (char const *pos) |
void | print (std::ostream &os, int indent=0) const |
output token in default XML format | |
void | printTab (std::ostream &os) |
output token in tab format | |
void | printTab (std::ostream &os, Corpus const &corpus) |
void | printConll08 (std::ostream &os, Corpus const &corpus, std::vector< int > *preds=0) |
output in CoNLL 2008 format. | |
Public Attributes | |
Token * | token |
unsigned | id |
std::vector< TreeToken * > | left |
list of left child tokens | |
std::vector< TreeToken * > | right |
list of right child tokens |
Definition at line 348 of file Token.h.
TreeToken * Tanl::TreeToken::ancestorCPos | ( | char const * | pos, | |
Sentence & | sent | |||
) |
TreeToken* Tanl::TreeToken::descendantCPos | ( | char const * | pos | ) | [inline] |
pos
. Definition at line 460 of file Token.h.
References descendantCPos(), get(), left, and right.
Referenced by descendantCPos().
TreeToken * Tanl::TreeToken::follow | ( | Parser::TokenPath const & | tp, | |
Sentence & | sentence | |||
) |
std::string const* Tanl::TreeToken::get | ( | char const * | key | ) | const [inline] |
key
, or 0 if not present. Definition at line 390 of file Token.h.
References Tanl::Token::attributes, and Tanl::Attributes::get().
Referenced by descendantCPos().
void Tanl::TreeToken::printConll08 | ( | std::ostream & | os, | |
Corpus const & | corpus, | |||
std::vector< int > * | preds = 0 | |||
) |
output in CoNLL 2008 format.
preds | contains the IDs of predicate tokens in sentence. |
void Tanl::TreeToken::set | ( | char const * | key, | |
std::string const & | value | |||
) | [inline] |
Add the attribute value
associated to key key
.
Definition at line 401 of file Token.h.
References Tanl::Token::set().
void Tanl::TreeToken::set | ( | char const * | key, | |
char const * | value | |||
) | [inline] |
Add the attribute value
associated to key key
.
Definition at line 396 of file Token.h.
References Tanl::Token::set().
int Tanl::TreeToken::size | ( | ) | [inline] |
Definition at line 422 of file Token.h.
Referenced by Parser::ParseState::hasNext().