43 #include "EST_THash.h"
44 #include "ling_class/EST_Item.h"
45 #include "ling_class/EST_Item_Content.h"
46 #include "ling_class/EST_Relation.h"
47 #include "ling_class/EST_FeatureFunctionPackage.h"
48 #include "EST_FeatureFunctionContext.h"
50 const char *error_name(EST_Item_featfunc f)
53 return "<<EST_Item_featfunc>>";
56 const EST_Item_featfunc get_featfunc(
const EST_String &name,
int must)
58 const EST_Item_featfunc f = EST_FeatureFunctionContext::global->get_featfunc(name, must);
63 void register_featfunc(
const EST_String &name,
const EST_Item_featfunc func)
65 if (EST_FeatureFunctionContext::global->get_featfunc(
"standard", name,0) != 0)
66 cerr <<
"item featfunc \"" << name <<
67 "\" redefined definition" << endl;
71 package->register_func(name,func);
74 EST_String get_featname(
const EST_Item_featfunc func)
78 EST_String name = EST_FeatureFunctionContext::global->get_featfunc_name(func, found);
81 EST_error(
"featfunc %p has no name", func);
86 void EST_register_feature_function_package(
const char *name,
90 EST_FeatureFunctionContext::global->add_package(package);
97 val_type val_type_featfunc =
"featfunc";
98 const EST_Item_featfunc featfunc(
const EST_Val &v)
100 if (v.
type() == val_type_featfunc)
101 return (
const EST_Item_featfunc)v.internal_ptr();
103 EST_error(
"val not of type val_type_featfunc");
107 void val_delete_featfunc(
void *v)
112 void val_copy_featfunc(
void *v1,
void *v2)
117 EST_Val est_val(
const EST_Item_featfunc f)
119 return EST_Val(val_type_featfunc,(
void *)f,val_delete_featfunc);
130 else if ((r == 0) || (r->
f(
"timing-style") !=
"segment"))
131 return s->f(
"start");
141 return prev(fl)->f(
"end");