KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
spear::Tree Class Reference

#include <Tree.h>

Inheritance diagram for spear::Tree:
spear::RCObject

Public Types

typedef std::list< RCIPtr
< spear::Tree > >::iterator 
iterator
 
typedef std::list< RCIPtr
< spear::Tree >
>::const_iterator 
const_iterator
 

Public Member Functions

 Tree ()
 
 Tree (const String &word, const String &label)
 
 Tree (const String &label)
 
const StringgetWord () const
 
void setWord (const String &w)
 
const StringgetLabel () const
 
void setLabel (const String &label)
 
const RCIPtr< spear::Tree > & getHead () const
 
const StringgetHeadWord () const
 
short getHeadPosition () const
 
const StringgetHeadNe () const
 
const StringgetHeadTag () const
 
void setHead (const RCIPtr< spear::Tree > &h)
 
void setLemma (const String &lemma)
 
bool isTerminal () const
 
void addChild (const RCIPtr< spear::Tree > &c, bool atEnd=true)
 
const std::list< RCIPtr
< spear::Tree > > & 
getChildren () const
 
std::list< RCIPtr< spear::Tree > > & children ()
 
void addPattern (const RCIPtr< spear::Pattern > &p)
 
const std::list< RCIPtr
< spear::Pattern > > & 
getPatterns () const
 
bool hasPatterns () const
 
const spear::VerbTypegetVerbType () const
 
void setVerbType (const spear::VerbType &vt)
 
void setNe (const String &ne)
 
const StringgetNe () const
 
void clear ()
 
void display (OStream &os, bool isHead=false, int offset=0) const
 
void displayParens (OStream &os, bool showHead=true) const
 
void displayPrettyParens (OStream &os, int offset=0, bool showHead=false) const
 
void displayProlog (OStream &os, int index) const
 
void displayPatterns (OStream &os, int offset=0) const
 
short setPositions ()
 
short getPosition () const
 
- Public Member Functions inherited from spear::RCObject
void addReference ()
 
void removeReference ()
 

Additional Inherited Members

- Public Attributes inherited from spear::RCObject
unsigned short refCount
 
- Protected Member Functions inherited from spear::RCObject
 RCObject ()
 
 RCObject (const RCObject &rhs)
 
RCObjectoperator= (const RCObject &rhs)
 
virtual ~RCObject ()=0
 

Member Typedef Documentation

Constructor & Destructor Documentation

spear::Tree::Tree ( )
inline
spear::Tree::Tree ( const String word,
const String label 
)
inline
spear::Tree::Tree ( const String label)
inline

Member Function Documentation

void spear::Tree::addChild ( const RCIPtr< spear::Tree > &  c,
bool  atEnd = true 
)
inline
void spear::Tree::addPattern ( const RCIPtr< spear::Pattern > &  p)
inline
std::list< RCIPtr<spear::Tree> >& spear::Tree::children ( )
inline

Returns non-const children list Note: Use with care! Update _head if children are changed!

void spear::Tree::clear ( )
inline
void Tree::display ( OStream os,
bool  isHead = false,
int  offset = 0 
) const
void Tree::displayParens ( OStream os,
bool  showHead = true 
) const
void Tree::displayPatterns ( OStream os,
int  offset = 0 
) const
void Tree::displayPrettyParens ( OStream os,
int  offset = 0,
bool  showHead = false 
) const
void spear::Tree::displayProlog ( OStream os,
int  index 
) const

Display the tree as a Prolog predicate

const std::list< RCIPtr<spear::Tree> >& spear::Tree::getChildren ( ) const
inline
const RCIPtr<spear::Tree>& spear::Tree::getHead ( ) const
inline
const String & Tree::getHeadNe ( ) const
short Tree::getHeadPosition ( ) const
const String & Tree::getHeadTag ( ) const

Returns the POS tag associated with the head word

const String & Tree::getHeadWord ( ) const
const String& spear::Tree::getLabel ( ) const
inline
const String& spear::Tree::getNe ( ) const
inline
const std::list< RCIPtr<spear::Pattern> >& spear::Tree::getPatterns ( ) const
inline
short spear::Tree::getPosition ( ) const
inline
const spear::VerbType& spear::Tree::getVerbType ( ) const
inline
const String& spear::Tree::getWord ( ) const
inline
bool Tree::hasPatterns ( ) const
bool spear::Tree::isTerminal ( ) const
inline
void spear::Tree::setHead ( const RCIPtr< spear::Tree > &  h)
inline
void spear::Tree::setLabel ( const String label)
inline
void spear::Tree::setLemma ( const String lemma)
inline
void spear::Tree::setNe ( const String ne)
inline
short Tree::setPositions ( )

Sets the _position fields for all terminal edges in this phrase The first token gets position 1 Returns the number of terminals in this sentence

void spear::Tree::setVerbType ( const spear::VerbType vt)
inline
void spear::Tree::setWord ( const String w)
inline

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