Edinburgh Speech Tools  2.1-release
EST_Item Class Reference

#include <include/ling_class/EST_Item.h>

Public Member Functions

EST_Item_Contentcontents () const
 
void set_contents (EST_Item_Content *li)
 
const EST_String name () const
 
void set_name (const EST_String &name) const
 
EST_Featuresfeatures () const
 
const EST_Val f (const EST_String &name) const
 
const EST_Val f (const EST_String &name, const EST_Val &def) const
 
EST_Itemnext () const
 
EST_Itemprev () const
 
EST_Itemdown () const
 
EST_Itemup () const
 
EST_Itemlast () const
 
EST_Itemfirst () const
 
EST_Itemtop () const
 
EST_Itembottom () const
 
EST_Itemfirst_leaf () const
 
EST_Itemnext_leaf () const
 
EST_Itemlast_leaf () const
 
EST_Itemnext_item () const
 
EST_Iteminsert_after (EST_Item *li=0)
 
EST_Iteminsert_before (EST_Item *li=0)
 
EST_Iteminsert_below (EST_Item *li=0)
 
EST_Iteminsert_above (EST_Item *li=0)
 
EST_Itemappend_daughter (EST_Item *li=0)
 
EST_Itemprepend_daughter (EST_Item *li=0)
 
EST_Iteminsert_parent (EST_Item *li=0)
 
void unref_all ()
 
int verify () const
 
EST_Itemoperator= (const EST_Item &s)
 
Constructor Functions
 EST_Item ()
 Default constructor. More...
 
 EST_Item (const EST_Item &item)
 Copy constructor only makes reference to contents. More...
 
 EST_Item (EST_Relation *rel)
 Includes reference to relation. More...
 
 EST_Item (EST_Relation *rel, EST_Item *si)
 Most common form of construction. More...
 
 ~EST_Item ()
 Deletes it and references to it in its contents. More...
 
Feature access functions.

These functions are wrap-around functions to the basic access functions in the EST_Features class. In all these functions, if the optional argument m is set to 1, an error is thrown if the feature does not exist

float F (const EST_String &name) const
 
float F (const EST_String &name, float def) const
 
const EST_String S (const EST_String &name) const
 
const EST_String S (const EST_String &name, const EST_String &def) const
 
int I (const EST_String &name) const
 
int I (const EST_String &name, int def) const
 
EST_FeaturesA (const EST_String &name) const
 
EST_FeaturesA (const EST_String &name, EST_Features &def) const
 
Feature setting functions.

A separate function is provided for each permissible value type

void set (const EST_String &name, ssize_t ival)
 
void set (const EST_String &name, float fval)
 
void set (const EST_String &name, double fval)
 
void set (const EST_String &name, const EST_String &sval)
 
void set (const EST_String &name, const char *cval)
 
void set_function (const EST_String &name, const EST_String &funcname)
 
void set (const EST_String &name, EST_Features &f)
 
void set_val (const EST_String &name, const EST_Val &sval)
 
Utility feature functions
void f_remove (const EST_String &name)
 
void evaluate_features ()
 
int f_present (const EST_String &name) const
 
int length () const
 
Cross relational access
EST_Itemas_relation (const char *relname) const
 View item from another relation (const char *) method. More...
 
int in_relation (const EST_String &relname) const
 TRUE if this item is in named relation. More...
 
EST_TKVL< EST_String, EST_Val > & relations ()
 Access to the relation links. More...
 
const EST_Stringrelation_name () const
 The relation name of this particular item. More...
 
EST_Relationrelation (void) const
 The relation of this particular item. More...
 
int same_item (const EST_Item *li) const
 True if li is the same item ignoring its relation viewpoint. More...
 

Static Public Member Functions

static void splice (EST_Item *a, EST_Item *b)
 

Static Protected Member Functions

static void class_init (void)
 

Friends

class EST_Relation
 
class ling_class_init
 
int i_same_item (const EST_Item *l1, const EST_Item *l2)
 
int move_item (EST_Item *from, EST_Item *to)
 
int merge_item (EST_Item *from, EST_Item *to)
 
int move_sub_tree (EST_Item *from, EST_Item *to)
 
int exchange_sub_trees (EST_Item *from, EST_Item *to)
 
ostream & operator<< (ostream &s, const EST_Item &a)
 
bool operator!= (const EST_Item &a, const EST_Item &b)
 
bool operator== (const EST_Item &a, const EST_Item &b)
 

Detailed Description

A class for containing individual linguistic objects such as words or phones.

These contain two types of information. This first is specific to the EST_Relation we are viewing this ling item from, the second part consists of a set of features. These features may be shared by instances of this ling item in different EST_Relation within the same EST_Utterance.

The shared part of an EST_Item is represented by the class EST_Item_Content. It should not normally be accessed by the general users as reverse links from the contents to each of the EST_Items it is part of are held ensure the integrity of the structures. Changing these without maintain the appropriate links is unlikely to be stable.

We believe this structure is the most efficient for the most natural use we envisage. Traversal of the items ....

Definition at line 83 of file EST_Item.h.

Constructor & Destructor Documentation

EST_Item::EST_Item ( )

Default constructor.

Definition at line 81 of file EST_Item.cc.

EST_Item::EST_Item ( const EST_Item item)

Copy constructor only makes reference to contents.

Definition at line 103 of file EST_Item.cc.

EST_Item::EST_Item ( EST_Relation rel)

Includes reference to relation.

Definition at line 142 of file EST_Item.cc.

EST_Item::EST_Item ( EST_Relation rel,
EST_Item si 
)

Most common form of construction.

Definition at line 162 of file EST_Item.cc.

EST_Item::~EST_Item ( )

Deletes it and references to it in its contents.

Definition at line 108 of file EST_Item.cc.

Member Function Documentation

void EST_Item::class_init ( void  )
staticprotected

Definition at line 66 of file EST_Item.cc.

float EST_Item::F ( const EST_String name) const
inline

return the value of the feature name cast as a float

Definition at line 135 of file EST_Item.h.

float EST_Item::F ( const EST_String name,
float  def 
) const
inline

return the value of the feature name cast as a float, returning def if not found.

Definition at line 139 of file EST_Item.h.

const EST_String EST_Item::S ( const EST_String name) const
inline

return the value of the feature name cast as a EST_String

Definition at line 144 of file EST_Item.h.

const EST_String EST_Item::S ( const EST_String name,
const EST_String def 
) const
inline

return the value of the feature name cast as a EST_String, returning def if not found.

Definition at line 150 of file EST_Item.h.

int EST_Item::I ( const EST_String name) const
inline

return the value of the feature name cast as a int

Definition at line 155 of file EST_Item.h.

int EST_Item::I ( const EST_String name,
int  def 
) const
inline

return the value of the feature name cast as a int returning def if not found.

Definition at line 159 of file EST_Item.h.

EST_Features& EST_Item::A ( const EST_String name) const
inline

return the value of the feature name cast as a EST_Features

Definition at line 164 of file EST_Item.h.

EST_Features& EST_Item::A ( const EST_String name,
EST_Features def 
) const
inline

return the value of the feature name cast as a EST_Features, returning def if not found.

Definition at line 170 of file EST_Item.h.

void EST_Item::set ( const EST_String name,
ssize_t  ival 
)
inline

set feature name to val

Definition at line 185 of file EST_Item.h.

void EST_Item::set ( const EST_String name,
float  fval 
)
inline

set feature name to val

Definition at line 189 of file EST_Item.h.

void EST_Item::set ( const EST_String name,
double  fval 
)
inline

set feature name to val

Definition at line 193 of file EST_Item.h.

void EST_Item::set ( const EST_String name,
const EST_String sval 
)
inline

set feature name to val

Definition at line 197 of file EST_Item.h.

void EST_Item::set ( const EST_String name,
const char *  cval 
)
inline

set feature name to val

Definition at line 201 of file EST_Item.h.

void EST_Item::set_function ( const EST_String name,
const EST_String funcname 
)
inline

set feature name to val, a function registered in the feature function list.

Definition at line 207 of file EST_Item.h.

void EST_Item::set ( const EST_String name,
EST_Features f 
)
inline

set feature name to f, a set of features, which is copied into the object.

Definition at line 213 of file EST_Item.h.

void EST_Item::set_val ( const EST_String name,
const EST_Val sval 
)
inline

set feature name to f, whose type is EST_Val.

Definition at line 220 of file EST_Item.h.

void EST_Item::f_remove ( const EST_String name)
inline

remove feature name

Definition at line 228 of file EST_Item.h.

void EST_Item::evaluate_features ( )

find all the attributes whose values are functions, and replace them with their evaluation.

Definition at line 172 of file EST_Item.cc.

int EST_Item::f_present ( const EST_String name) const
inline

TRUE if feature is present, FALSE otherwise

Definition at line 236 of file EST_Item.h.

int EST_Item::length ( void  ) const

Definition at line 228 of file EST_Item.cc.

EST_Item_Content* EST_Item::contents ( ) const
inline

Definition at line 244 of file EST_Item.h.

void EST_Item::set_contents ( EST_Item_Content li)

Definition at line 202 of file EST_Item.cc.

const EST_String EST_Item::name ( void  ) const
inline

Definition at line 250 of file EST_Item.h.

void EST_Item::set_name ( const EST_String name) const
inline

Definition at line 254 of file EST_Item.h.

EST_Features& EST_Item::features ( ) const
inline

Definition at line 258 of file EST_Item.h.

const EST_Val EST_Item::f ( const EST_String name) const
inline

Definition at line 260 of file EST_Item.h.

const EST_Val EST_Item::f ( const EST_String name,
const EST_Val def 
) const
inline

Definition at line 296 of file EST_Item.h.

EST_Item* EST_Item::as_relation ( const char *  relname) const
inline

View item from another relation (const char *) method.

Definition at line 316 of file EST_Item.h.

int EST_Item::in_relation ( const EST_String relname) const
inline

TRUE if this item is in named relation.

Definition at line 320 of file EST_Item.h.

EST_TKVL<EST_String, EST_Val>& EST_Item::relations ( )
inline

Access to the relation links.

Definition at line 324 of file EST_Item.h.

const EST_String & EST_Item::relation_name ( ) const

The relation name of this particular item.

Definition at line 196 of file EST_Item.cc.

EST_Relation* EST_Item::relation ( void  ) const
inline

The relation of this particular item.

Definition at line 330 of file EST_Item.h.

int EST_Item::same_item ( const EST_Item li) const
inline

True if li is the same item ignoring its relation viewpoint.

Definition at line 334 of file EST_Item.h.

static void EST_Item::splice ( EST_Item a,
EST_Item b 
)
inlinestatic

Definition at line 343 of file EST_Item.h.

EST_Item* EST_Item::next ( ) const
inline

Definition at line 348 of file EST_Item.h.

EST_Item* EST_Item::prev ( ) const
inline

Definition at line 350 of file EST_Item.h.

EST_Item* EST_Item::down ( ) const
inline

Definition at line 352 of file EST_Item.h.

EST_Item* EST_Item::up ( ) const
inline

Definition at line 354 of file EST_Item.h.

EST_Item * EST_Item::last ( ) const

Definition at line 329 of file EST_Item.cc.

EST_Item * EST_Item::first ( ) const

Definition at line 339 of file EST_Item.cc.

EST_Item * EST_Item::top ( ) const

Definition at line 349 of file EST_Item.cc.

EST_Item* EST_Item::bottom ( ) const
EST_Item * EST_Item::first_leaf ( ) const

Definition at line 386 of file EST_Item.cc.

EST_Item * EST_Item::next_leaf ( ) const

Definition at line 358 of file EST_Item.cc.

EST_Item * EST_Item::last_leaf ( ) const

Definition at line 397 of file EST_Item.cc.

EST_Item * EST_Item::next_item ( ) const

Definition at line 368 of file EST_Item.cc.

EST_Item * EST_Item::insert_after ( EST_Item li = 0)

Definition at line 236 of file EST_Item.cc.

EST_Item * EST_Item::insert_before ( EST_Item li = 0)

Definition at line 255 of file EST_Item.cc.

EST_Item * EST_Item::insert_below ( EST_Item li = 0)

Definition at line 280 of file EST_Item.cc.

EST_Item * EST_Item::insert_above ( EST_Item li = 0)

Definition at line 294 of file EST_Item.cc.

EST_Item * EST_Item::append_daughter ( EST_Item li = 0)

Definition at line 425 of file EST_Item.cc.

EST_Item * EST_Item::prepend_daughter ( EST_Item li = 0)

Definition at line 464 of file EST_Item.cc.

EST_Item * EST_Item::insert_parent ( EST_Item li = 0)

Definition at line 313 of file EST_Item.cc.

void EST_Item::unref_all ( )

Definition at line 189 of file EST_Item.cc.

int EST_Item::verify ( ) const

Definition at line 559 of file EST_Item.cc.

EST_Item & EST_Item::operator= ( const EST_Item s)

Definition at line 623 of file EST_Item.cc.

Friends And Related Function Documentation

friend class EST_Relation
friend

Definition at line 408 of file EST_Item.h.

friend class ling_class_init
friend

Definition at line 409 of file EST_Item.h.

int i_same_item ( const EST_Item l1,
const EST_Item l2 
)
friend

Definition at line 412 of file EST_Item.h.

int move_item ( EST_Item from,
EST_Item to 
)
friend

Definition at line 115 of file item_aux.cc.

int merge_item ( EST_Item from,
EST_Item to 
)
friend

Definition at line 85 of file item_aux.cc.

int move_sub_tree ( EST_Item from,
EST_Item to 
)
friend

Definition at line 128 of file item_aux.cc.

int exchange_sub_trees ( EST_Item from,
EST_Item to 
)
friend

Definition at line 158 of file item_aux.cc.

ostream& operator<< ( ostream &  s,
const EST_Item a 
)
friend

Definition at line 629 of file EST_Item.cc.

bool operator!= ( const EST_Item a,
const EST_Item b 
)
friend

Definition at line 403 of file EST_Item.h.

bool operator== ( const EST_Item a,
const EST_Item b 
)
friend

Definition at line 405 of file EST_Item.h.


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