69 cerr <<
"Calling EST_Item init\n";
77 cerr <<
"Finished EST_Item init\n";
89 void EST_Item::copy(
const EST_Item &s)
100 *p_contents = *s.p_contents;
121 if (p != 0) p->n = n;
122 if (u != 0) u->d = n;
126 if (p_relation->p_head ==
this)
127 p_relation->p_head = n;
128 if (p_relation->p_tail ==
this)
129 p_relation->p_tail = p;
133 for (ds=d; ds != 0; ds=nds)
177 void EST_Item::unref_contents()
198 return ((
this == 0) || (p_relation == 0)) ?
207 if (new_contents == 0)
232 for (; nn; nn=nn->n,i++);
244 new_node->n = this->n;
245 if (new_node->n != 0)
246 new_node->n->p = new_node;
249 if (p_relation && (p_relation->p_tail ==
this))
250 p_relation->p_tail = new_node;
261 new_node->p = this->p;
262 if (new_node->p != 0)
263 new_node->p->n = new_node;
269 new_node->u = this->u;
270 new_node->u->d = new_node;
274 if (p_relation && (p_relation->p_head ==
this))
275 p_relation->p_head = new_node;
286 new_node->d = this->d;
287 if (new_node->d != 0)
288 new_node->d->u = new_node;
300 new_node->u = this->u;
301 if (new_node->u != 0)
302 new_node->u->d = new_node;
305 if (p_relation && (p_relation->p_head ==
this))
306 p_relation->p_head = new_node;
307 if (p_relation && (p_relation->p_tail ==
this))
308 p_relation->p_tail = new_node;
317 if (
this == 0)
return 0;
334 if (
this == 0)
return 0;
335 for (; node->n != 0; node=node->n);
344 if (
this == 0)
return 0;
345 for (; node->p != 0; node=node->p);
353 if (
this == 0)
return 0;
362 else if (
next() != 0)
373 else if (
down() != 0)
375 else if (
next() != 0)
419 else if (root->
down() == 0)
441 if (its_downs) its_downs->u = 0;
450 its_downs->u = nnode;
451 nnode->d = its_downs;
456 else if (
down() == 0)
480 if (its_downs) its_downs->u = 0;
489 its_downs->u = nnode;
490 nnode->d = its_downs;
495 else if (
down() == 0)
503 EST_Item *EST_Item::grab_daughters()
532 if (from->
next() != 0)
535 if (from->
down() != 0)
545 if (from->
next() != 0)
551 if (from->
down() != 0)
563 bool verif_d =
false;
564 bool verif_n =
false;
571 if ( (d->u ==
this) && d->
verify() ) {
581 if ( (n->p ==
this) && n->
verify() ) {
588 if (verif_d && verif_n)
619 if ((lr != 0) && (r != 0))
640 for(p.
begin(f); p; ++p)
647 fprintf(stderr,
"NULL %s function\n", (
const char *) p->k );
#define EST_register_feature_functions(PACKAGE)
EST_Item * insert_below(EST_Item *li=0)
EST_Item * Relation(const char *name)
EST_Item_featfunc featfunc(const EST_Val &v)
EST_Item * last_leaf() const
EST_Item & operator=(const EST_Item &s)
void set_contents(EST_Item_Content *li)
EST_Item * as(const EST_Item *n, const char *relname)
EST_Item * insert_above(EST_Item *li=0)
EST_Item * append_daughter(EST_Item *li=0)
void remove_item(EST_Item *item)
~EST_Item()
Deletes it and references to it in its contents.
void set(const EST_String &name, ssize_t ival)
EST_Val est_val(const EST_Item_featfunc f)
EST_Item * next_item() const
EST_String itoString(int n)
Make a EST_String object from an integer.
EST_Item * root(const EST_Item *n)
return root node of treeprevious sibling (sister) of n
EST_Item * as_relation(const char *relname) const
View item from another relation (const char *) method.
EST_Features f
General features for this item.
EST_Item * insert_parent(EST_Item *li=0)
const EST_Val f(const EST_String &name) const
void begin(Container &over)
Set the iterator ready to run over this container.
EST_Item()
Default constructor.
EST_TKVL< EST_String, EST_Val > relations
void copy_node_tree_contents(EST_Item *from, EST_Item *to)
val_type val_type_featfunc
const EST_String & name() const
const EST_String & relation_name() const
The relation name of this particular item.
#define VAL_REGISTER_CLASS_NODEL(NAME, CLASS)
EST_Item_Content * contents() const
EST_Item * insert_before(EST_Item *li=0)
int in_list(const EST_Item *c, const EST_Item *l)
EST_TVector< T > & copy(EST_TVector< T > a, const EST_TList< T > &in)
EST_Item * insert_after(EST_Item *li=0)
EST_Features & features() const
EST_Relation * relation(void) const
The relation of this particular item.
EST_write_status save(ostream &outf) const
save features in already opened ostream
EST_Item * first_leaf_in_tree(const EST_Item *root)
int add_item(const K &rkey, const V &rval, int no_search=0)
add key-val pair to list
EST_Item * prepend_daughter(EST_Item *li=0)
EST_Utterance * get_utt(EST_Item *s)
int next_id()
return the id of the next item
void evaluate(EST_Item *a, EST_Features &f)
friend ostream & operator<<(ostream &s, const EST_Item &a)
static EST_Val feature_default_value
EST_Item * first_leaf() const
EST_Item * last_leaf_in_tree(const EST_Item *root)
EST_Item * parent(const EST_Item *n)
return parent of n
EST_Item * next_leaf() const
static const EST_String Empty
Constant empty string.
void remove_item(EST_Item *l, const char *relname)
void copy_node_tree(EST_Item *from, EST_Item *to)
int unref_relation(const EST_String &relname)
Utility EST_String Functions header file.
static void class_init(void)
int f_present(const EST_String &name) const