ZGen
0.2.0
a linearization system for natural language.
|
#include <tree.h>
Public Member Functions | |
int | set_ref (const dependency_t *ref) |
int | root (int i) const |
int | depth (int i) const |
int | lca (int u, int v) const |
bool | is_root (int i) const |
bool | same_ancestor (int u, int v) const |
![]() | |
DependencyTree () | |
~DependencyTree () | |
const edgeset_t & | siblings (int i) |
Access the siblings of node i. More... | |
const edgeset_t & | descendants (int i) |
Access the descendants of node i. More... | |
const edgeset_t & | children (int i) |
Access the children of node i. More... | |
int | head (int i) |
Access the head of node i. More... | |
bool | arc (int source, int target) |
Return if there is an edge between source and target. More... | |
Protected Member Functions | |
void | reset (int N=kMaxNumberOfWords) |
![]() | |
void | dependency_to_tree (const dependency_t *parse) |
Convert the dependency parse into the dependency tree. More... | |
void | go (int now) |
Friends | |
std::ostream & | operator<< (std::ostream &ofs, const DependencyForest &tree) |
Additional Inherited Members | |
![]() | |
typedef std::vector< int > | edgeset_t |
![]() | |
const dependency_t * | ref |
The reference to the dependency parse instance. More... | |
edgeset_t | children_ [kMaxNumberOfWords] |
Record the children for each node. More... | |
int | parent_ [kMaxNumberOfWords] |
Record the parent for each node. More... | |
int | indgr_ [kMaxNumberOfWords] |
Record the in degree of the graph. More... | |
edgeset_t | descendants_ [kMaxNumberOfWords] |
Record the descendant for each node. More... | |
edgeset_t | siblings_ [kMaxNumberOfWords] |
Record the siblings for each node. More... | |
int ZGen::DependencyForest::depth | ( | int | i | ) | const |
bool ZGen::DependencyForest::is_root | ( | int | i | ) | const |
int ZGen::DependencyForest::lca | ( | int | u, |
int | v | ||
) | const |
|
protectedvirtual |
Clear all the cached information.
Reimplemented from ZGen::DependencyTree.
int ZGen::DependencyForest::root | ( | int | i | ) | const |
bool ZGen::DependencyForest::same_ancestor | ( | int | u, |
int | v | ||
) | const |
|
virtual |
Set the dependency tree reference onto the tree.
[in] | _ref | The reference of the dependency tree. |
Reimplemented from ZGen::DependencyTree.
|
friend |