ZGen  0.2.0
a linearization system for natural language.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ZGen::DependencyTree Class Reference

#include <tree.h>

Inheritance diagram for ZGen::DependencyTree:
ZGen::DependencyForest ZGen::DependencyTreeWithGuidance

Public Types

typedef std::vector< int > edgeset_t
 

Public Member Functions

 DependencyTree ()
 
 ~DependencyTree ()
 
virtual int set_ref (const dependency_t *_ref)
 
const edgeset_tsiblings (int i)
 Access the siblings of node i. More...
 
const edgeset_tdescendants (int i)
 Access the descendants of node i. More...
 
const edgeset_tchildren (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_tref
 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)
 

Member Typedef Documentation

typedef std::vector<int> ZGen::DependencyTree::edgeset_t

Constructor & Destructor Documentation

ZGen::DependencyTree::DependencyTree ( )
ZGen::DependencyTree::~DependencyTree ( )

Member Function Documentation

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.

void ZGen::DependencyTree::dependency_to_tree ( const dependency_t parse)
protected

Convert the dependency parse into the dependency tree.

const DependencyTree::edgeset_t & ZGen::DependencyTree::descendants ( int  i)

Access the descendants of node i.

void ZGen::DependencyTree::go ( int  now)
protected

The deap first process.

Parameters
[in]nowThe currently visited ode.
int ZGen::DependencyTree::head ( int  i)

Access the head of node i.

void ZGen::DependencyTree::reset ( int  N = kMaxNumberOfWords)
protectedvirtual

Clear all the cached information.

Reimplemented in ZGen::DependencyForest, and ZGen::DependencyTreeWithGuidance.

int ZGen::DependencyTree::set_ref ( const dependency_t _ref)
virtual

Set the dependency tree reference onto the tree.

Parameters
[in]_refThe reference of the dependency tree.
Returns
int The root index.

Reimplemented in ZGen::DependencyForest, and ZGen::DependencyTreeWithGuidance.

const DependencyTree::edgeset_t & ZGen::DependencyTree::siblings ( int  i)

Access the siblings of node i.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ofs,
const DependencyTree tree 
)
friend

Member Data Documentation

edgeset_t ZGen::DependencyTree::children_[kMaxNumberOfWords]
protected

Record the children for each node.

edgeset_t ZGen::DependencyTree::descendants_[kMaxNumberOfWords]
protected

Record the descendant for each node.

int ZGen::DependencyTree::indgr_[kMaxNumberOfWords]
protected

Record the in degree of the graph.

int ZGen::DependencyTree::parent_[kMaxNumberOfWords]
protected

Record the parent for each node.

const dependency_t* ZGen::DependencyTree::ref
protected

The reference to the dependency parse instance.

edgeset_t ZGen::DependencyTree::siblings_[kMaxNumberOfWords]
protected

Record the siblings for each node.


The documentation for this class was generated from the following files: