38 #ifndef __EST_FEATURES_H__
39 #define __EST_FEATURES_H__
43 #include "EST_types.h"
44 #include "EST_TIterator.h"
45 #include "EST_error.h"
54 EST_Val est_val(const EST_Item_featfunc f);
66 void save_fpair(ostream &outf,
70 static EST_Val feature_default_value;
72 EST_Features(
const EST_Features &f);
85 const EST_Val &val(
const char *name)
const;
104 {
return val_path(path);}
110 {
return val_path(path, def);}
115 {
return val_path(path); }
121 {
return val_path(path,def); }
136 {
return val_path(path).
Float(); }
142 {
return val_path(path, def).
Float(); }
147 {
return val_path(path).
Int(); }
153 {
return val_path(path, def).
Int(); }
158 {
return val_path(path).
string(); }
165 {
return val_path(path, def).
string(); }
170 {
return *feats(val_path(path));}
175 EST_Features &A(
const EST_String &path, EST_Features &def)
const;
186 {
EST_Val pv(ival); set_path(name, pv);}
192 {
EST_Val pv(fval); set_path(name, pv); }
198 {
EST_Val pv((
float)dval); set_path(name, pv); }
204 {
EST_Val pv(sval); set_path(name, pv); }
210 {
EST_Val pv(cval); set_path(name, pv); }
236 { EST_Features *ff =
new EST_Features(f);
237 set_path(name, est_val(ff)); }
259 EST_Features&
operator = (
const EST_Features& a);
262 { f.
save(s);
return s; }
271 float F(
EST_Litem *p)
const {
return features->
list(p).v.Float(); }
273 int I(
EST_Litem *p)
const {
return features->
list(p).v.Int(); }
274 EST_Features &A(
EST_Litem *p) {
return *feats(features->
list(p).v); }
282 void point_to_first(
IPointer &ip)
const
283 { ip.i.begin(*features);}
284 void move_pointer_forwards(IPointer &ip)
const
286 bool points_to_something(
const IPointer &ip)
const
287 {
return ip.i != 0; }
316 EST_write_status save(ostream &outf)
const;
318 EST_write_status save_sexpr(ostream &outf)
const;
323 inline bool operator == (
const EST_Features &a,
const EST_Features &b)
324 {(void)a; (void)b;
return false;}
326 void merge_features(EST_Features &to,EST_Features &from);