47#include "EST_String.h"
48#include "EST_Features.h"
49#include "ling_class/EST_Item_Content.h"
53const EST_Item_featfunc featfunc(
const EST_Val &v);
54EST_Val est_val(
const EST_Item_featfunc f);
95 void unref_contents();
107 static void class_init(
void);
134 const float F(
const EST_String &name)
const {
return f(name).Float();}
139 {
return f(name,def).Float();}
150 {
return f(name, def).string();}
159 {
return f(name, def).Int();}
171 return *
feats(f(name, est_val(
ff)));}
223 { features().
remove(name); }
233 return features().
present(name);
249 {
return f(
"name",0).string(); }
262 v.
type() == val_type_featfunc && featfunc(v) != NULL;
263 v=(featfunc(v))((
EST_Item *)(
void *)
this));
264 if (v.
type() == val_type_featfunc)
265 EST_error(
"NULL %s function",(
const char *)name);
277 for (v=&(p_contents->
f.
val_path(name, def));
278 v->
type() == val_type_featfunc && featfunc(*v) != NULL;
279 v=&(featfunc(*v))((
EST_Item *)(
void *)
this));
280 if (v->
type() == val_type_featfunc)
290 for (v=p_contents->
f.
val_path(name, def);
291 v.
type() == val_type_featfunc && featfunc(v) != NULL;
292 v=(featfunc(v))((
EST_Item *)(
void *)
this));
293 if (v.
type() == val_type_featfunc)
303 {
return p_contents->Relation(
relname); }
307 {
return p_contents->in_relation(
relname); }
317 {
return (
this == 0) ? 0 : p_relation; }
321 {
return contents() &&
li->contents() && (contents() ==
li->contents()); }
330 {
if(a !=NULL) a->n = b;
if (b != NULL) b->p=a; }
372 {
return !i_same_item(&a,&b); }
374 {
return i_same_item(&a,&b); }
382 return l1->contents() &&
l2->contents() &&
383 (
l1->contents() ==
l2->contents());
407#include "ling_class/EST_Relation_list.h"
408#include "ling_class/EST_Relation_tree.h"
409#include "ling_class/EST_Relation_mls.h"
418#include "ling_class/EST_FeatureFunctionPackage.h"
423void register_featfunc(
const EST_String &name,
const EST_Item_featfunc func);
424const EST_Item_featfunc get_featfunc(
const EST_String &name,
int must=0);
425EST_String get_featname(
const EST_Item_featfunc func);
427#define EST_register_feature_functions(PACKAGE) \
429 extern void register_ ## PACKAGE ## _feature_functions(EST_FeatureFunctionPackage &p); \
430 EST_register_feature_function_package( #PACKAGE , register_ ## PACKAGE ## _feature_functions); \
void set_path(const EST_String &name, const EST_Val &sval)
void remove(const EST_String &name)
void set_function(const EST_String &name, const EST_String &f)
int present(const EST_String &name) const
const EST_Val & val_path(const EST_String &path) const
EST_Features f
General features for this item.
void set_name(const EST_String &s)
set name
void set(const EST_String &name, double fval)
int in_relation(const EST_String &relname) const
TRUE if this item is in named relation.
const int I(const EST_String &name) const
const float F(const EST_String &name, float def) const
EST_Relation * relation(void) const
The relation of this particular item.
void set(const EST_String &name, int ival)
EST_TKVL< EST_String, EST_Val > & relations()
Access to the relation links.
const EST_String S(const EST_String &name, const EST_String &def) const
const int I(const EST_String &name, int def) const
void set(const EST_String &name, EST_Features &f)
const EST_String S(const EST_String &name) const
void set(const EST_String &name, const EST_String &sval)
EST_Features & A(const EST_String &name, EST_Features &def) const
EST_Features & A(const EST_String &name) const
const EST_String & relation_name() const
The relation name of this particular item.
const float F(const EST_String &name) const
void set(const EST_String &name, float fval)
void set_val(const EST_String &name, const EST_Val &sval)
void set_function(const EST_String &name, const EST_String &funcname)
void f_remove(const EST_String &name)
void set(const EST_String &name, const char *cval)
EST_Item * as_relation(const char *relname) const
View item from another relation (const char *) method.
EST_Item()
Default constructor.
int f_present(const EST_String &name) const
~EST_Item()
Deletes it and references to it in its contents.
int same_item(const EST_Item *li) const
True if li is the same item ignoring its relation viewpoint.
const val_type type(void) const