44 #ifndef __EST_ITEM_H__ 45 #define __EST_ITEM_H__ 96 void unref_contents();
140 {
return f(name,def).
Float();}
151 {
return f(name, def).
string();}
160 {
return f(name, def).
Int();}
172 return *feats(
f(name,
est_val(ff)));}
179 #if (SSIZE_MAX != INT_MAX) 255 {
if (
this != 0) p_contents->
set_name(name); }
265 EST_error(
"item is null so has no %s feature",(
const char *)name);
286 for (v=&(p_contents->
f.
val_path(name, def));
303 for (v=p_contents->
f.
val_path(name, def);
317 {
return (
this == 0) ? 0 : p_contents->
Relation(relname); }
321 {
return (
this == 0) ? 0 : p_contents->
in_relation(relname); }
331 {
return (
this == 0) ? 0 : p_relation; }
344 {
if(a !=
NULL) a->n = b;
if (b !=
NULL) b->p=a; }
447 #define EST_register_feature_functions(PACKAGE) \ 449 extern void register_ ## PACKAGE ## _feature_functions(EST_FeatureFunctionPackage &p); \ 450 EST_register_feature_function_package( #PACKAGE , register_ ## PACKAGE ## _feature_functions); \ EST_Item * insert_below(EST_Item *li=0)
EST_Item * Relation(const char *name)
EST_Item_featfunc featfunc(const EST_Val &v)
void set_function(const EST_String &name, const EST_String &funcname)
EST_Val(* EST_Item_featfunc)(EST_Item *s)
EST_Item * last_leaf() const
void set_function(const EST_String &name, const EST_String &f)
friend bool operator==(const EST_Item &a, const EST_Item &b)
const EST_String name() const
EST_Item & operator=(const EST_Item &s)
int same_item(const EST_Item *li) const
True if li is the same item ignoring its relation viewpoint.
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)
int I(const EST_String &name) const
EST_Item * append_daughter(EST_Item *li=0)
int in_relation(const EST_String &relname) const
TRUE if this item is in named relation.
~EST_Item()
Deletes it and references to it in its contents.
void EST_register_feature_function_package(const char *name, void(*init_fn)(EST_FeatureFunctionPackage &p))
EST_Item * bottom() const
EST_String get_featname(const EST_Item_featfunc func)
int I(const EST_String &name, int def) const
EST_Item * next_item() const
void register_featfunc(const EST_String &name, const EST_Item_featfunc func)
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 set_path(const EST_String &name, const EST_Val &sval)
EST_Val est_val(const EST_Item_featfunc f)
EST_Item()
Default constructor.
EST_TKVL< EST_String, EST_Val > relations
friend int exchange_sub_trees(EST_Item *from, EST_Item *to)
void set_name(const EST_String &name) const
val_type val_type_featfunc
float F(const EST_String &name) const
const EST_String & relation_name() const
The relation name of this particular item.
EST_TKVL< EST_String, EST_Val > & relations()
Access to the relation links.
void evaluate(EST_Item *a, EST_Features &f)
EST_Item_Content * contents() const
val_type type(void) const
void set_val(const EST_String &name, const EST_Val &sval)
EST_Item * insert_before(EST_Item *li=0)
friend int i_same_item(const EST_Item *l1, const EST_Item *l2)
void remove(const EST_String &name)
void copy_node_tree_contents(EST_Item *from, EST_Item *to)
void copy_node_tree(EST_Item *from, EST_Item *to)
int present(const EST_String &name) const
EST_Item * insert_after(EST_Item *li=0)
const EST_Val & val_path(const EST_String &path) const
EST_Features & features() const
const EST_String & string(void) const
EST_Relation * relation(void) const
The relation of this particular item.
void set_name(const EST_String &s)
set name
EST_Features & A(const EST_String &name) const
static void splice(EST_Item *a, EST_Item *b)
float F(const EST_String &name, float def) const
EST_Item * prepend_daughter(EST_Item *li=0)
friend bool operator!=(const EST_Item &a, const EST_Item &b)
friend int move_sub_tree(EST_Item *from, EST_Item *to)
int in_relation(const EST_String &name) const
friend int move_item(EST_Item *from, EST_Item *to)
friend int merge_item(EST_Item *from, EST_Item *to)
EST_Item_featfunc get_featfunc(const EST_String &name, int must=0)
EST_Features & A(const EST_String &name, EST_Features &def) const
const EST_String S(const EST_String &name, const EST_String &def) const
const EST_String S(const EST_String &name) const
friend ostream & operator<<(ostream &s, const EST_Item &a)
EST_Item * first_leaf() const
void f_remove(const EST_String &name)
EST_Item * next_leaf() const
void remove_item(EST_Item *l, const char *relname)
static const EST_String Empty
Constant empty string.
const EST_Val f(const EST_String &name, const EST_Val &def) const
static void class_init(void)
int f_present(const EST_String &name) const