44 #ifndef __EST_ITEM_H__
45 #define __EST_ITEM_H__
47 #include "EST_String.h"
48 #include "EST_Features.h"
49 #include "ling_class/EST_Item_Content.h"
52 extern val_type val_type_featfunc;
53 const EST_Item_featfunc featfunc(
const EST_Val &v);
54 EST_Val est_val(
const EST_Item_featfunc f);
95 void unref_contents();
107 static void class_init(
void);
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)));}
209 features().
set_path(name, est_val(ff)); }
223 { features().
remove(name); }
231 {
return features().
present(name); }
249 {
if (
this != 0) p_contents->
set_name(name); }
259 EST_error(
"item is null so has no %s feature",(
const char *)name);
264 v.
type() == val_type_featfunc && featfunc(v) != NULL;
265 v=(featfunc(v))((
EST_Item *)(
void *)
this));
266 if (v.
type() == val_type_featfunc)
267 EST_error(
"NULL %s function",(
const char *)name);
280 for (v=&(p_contents->
f.
val_path(name, def));
281 v->
type() == val_type_featfunc && featfunc(*v) != NULL;
282 v=&(featfunc(*v))((
EST_Item *)(
void *)
this));
283 if (v->
type() == val_type_featfunc)
297 for (v=p_contents->
f.
val_path(name, def);
298 v.
type() == val_type_featfunc && featfunc(v) != NULL;
299 v=(featfunc(v))((
EST_Item *)(
void *)
this));
300 if (v.
type() == val_type_featfunc)
311 {
return (
this == 0) ? 0 : p_contents->Relation(relname); }
315 {
return (
this == 0) ? 0 : p_contents->in_relation(relname); }
325 {
return (
this == 0) ? 0 : p_relation; }
329 {
return contents() && li->contents() && (contents() == li->contents()); }
338 {
if(a !=NULL) a->n = b;
if (b != NULL) b->p=a; }
342 EST_Item *next()
const {
return this == 0 ? 0 : n; }
344 EST_Item *prev()
const {
return this == 0 ? 0 : p; }
346 EST_Item *down()
const {
return this == 0 ? 0 : d; }
348 EST_Item *up()
const {
return this == 0 ? 0 : u; }
396 friend ostream& operator << (ostream &s,
const EST_Item &a);
398 {
return !i_same_item(&a,&b); }
400 {
return i_same_item(&a,&b); }
408 return l1->contents() && l2->contents() &&
409 (l1->contents() == l2->contents());
417 #include "ling_class/EST_Relation_list.h"
418 #include "ling_class/EST_Relation_tree.h"
419 #include "ling_class/EST_Relation_mls.h"
422 {
return node->next_item(); }
424 void remove_item(
EST_Item *l,
const char *relname);
432 #include "ling_class/EST_FeatureFunctionPackage.h"
437 void register_featfunc(
const EST_String &name,
const EST_Item_featfunc func);
438 const EST_Item_featfunc get_featfunc(
const EST_String &name,
int must=0);
439 EST_String get_featname(
const EST_Item_featfunc func);
441 #define EST_register_feature_functions(PACKAGE) \
443 extern void register_ ## PACKAGE ## _feature_functions(EST_FeatureFunctionPackage &p); \
444 EST_register_feature_function_package( #PACKAGE , register_ ## PACKAGE ## _feature_functions); \