|
ZGen
0.2.0
a linearization system for natural language.
|
#include <tree.h>
Public Types | |
| typedef std::vector< int > | edgeset_t |
Public Member Functions | |
| DependencyTree () | |
| ~DependencyTree () | |
| virtual int | set_ref (const dependency_t *_ref) |
| 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 | |
| virtual 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) |
Protected Attributes | |
| 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... | |
Friends | |
| std::ostream & | operator<< (std::ostream &ofs, const DependencyTree &tree) |
| typedef std::vector<int> ZGen::DependencyTree::edgeset_t |
| ZGen::DependencyTree::DependencyTree | ( | ) |
| ZGen::DependencyTree::~DependencyTree | ( | ) |
| bool ZGen::DependencyTree::arc | ( | int | source, |
| int | target | ||
| ) |
Return if there is an edge between source and target.
| const DependencyTree::edgeset_t & ZGen::DependencyTree::children | ( | int | i | ) |
Access the children of node i.
|
protected |
Convert the dependency parse into the dependency tree.
| const DependencyTree::edgeset_t & ZGen::DependencyTree::descendants | ( | int | i | ) |
Access the descendants of node i.
|
protected |
The deap first process.
| [in] | now | The currently visited ode. |
| int ZGen::DependencyTree::head | ( | int | i | ) |
Access the head of node i.
|
protectedvirtual |
Clear all the cached information.
Reimplemented in ZGen::DependencyForest, and ZGen::DependencyTreeWithGuidance.
|
virtual |
Set the dependency tree reference onto the tree.
| [in] | _ref | The reference of the dependency tree. |
Reimplemented in ZGen::DependencyForest, and ZGen::DependencyTreeWithGuidance.
| const DependencyTree::edgeset_t & ZGen::DependencyTree::siblings | ( | int | i | ) |
Access the siblings of node i.
|
friend |
|
protected |
Record the children for each node.
|
protected |
Record the descendant for each node.
|
protected |
Record the in degree of the graph.
|
protected |
Record the parent for each node.
|
protected |
The reference to the dependency parse instance.
|
protected |
Record the siblings for each node.
1.8.6