38 #ifndef __EST_FEATURES_H__ 39 #define __EST_FEATURES_H__ 67 void save_fpair(ostream &outf,
73 EST_Features(
const EST_Features &f);
105 {
return val_path(path);}
111 {
return val_path(path, def);}
116 {
return val_path(path); }
122 {
return val_path(path,def); }
137 {
return val_path(path).Float(); }
143 {
return val_path(path, def).Float(); }
148 {
return val_path(path).Int(); }
154 {
return val_path(path, def).Int(); }
159 {
return val_path(path).string(); }
166 {
return val_path(path, def).string(); }
171 {
return *feats(val_path(path));}
176 EST_Features *A(
const EST_String &path, EST_Features &def)
const;
187 {
EST_Val pv(ival); set_path(name, pv);}
193 {
EST_Val pv(fval); set_path(name, pv); }
199 {
EST_Val pv((
float)dval); set_path(name, pv); }
205 {
EST_Val pv(sval); set_path(name, pv); }
211 {
EST_Val pv(cval); set_path(name, pv); }
237 { EST_Features *ff =
new EST_Features(f);
260 EST_Features&
operator = (
const EST_Features& a);
263 { f.
save(s);
return s; }
272 float F(
EST_Litem *p)
const {
return features->
list(p).v.Float(); }
274 int I(
EST_Litem *p)
const {
return features->
list(p).v.Int(); }
275 EST_Features &A(
EST_Litem *p) {
return *feats(features->
list(p).v); }
284 { ip.
i.begin(*features);}
288 {
return ip.
i != 0; }
325 {(void)a; (void)b;
return false;}
bool points_to_something(const IPointer &ip) const
EST_Val(* EST_Item_featfunc)(class EST_Item *)
void point_to_first(IPointer &ip) const
void set_val(const EST_String &name, const EST_Val &sval)
EST_Val est_val(const EST_Item_featfunc f)
bool save(Lattice &lattice, EST_String filename)
bool load(Lattice &lattice, EST_String filename)
const EST_String S(const EST_String &path) const
EST_TKVL< EST_String, EST_Val > * features
Templated Key-Value Item. Serves as the items in the list of the EST_TKVL class.
float F(const EST_String &path, float def) const
const EST_Val & f(const EST_String &path) const
const EST_Val & f(const EST_String &path, const EST_Val &def) const
#define VAL_REGISTER_CLASS_DCLS(NAME, CLASS)
int I(const EST_String &path, int def) const
char operator()(int i) const
Function style access to constant strings.
EST_TList< EST_TKVI< K, V > > list
Linked list of key-val pairs. Don't use this as it will be made private in the future.
EST_TKVI< EST_String, EST_Val > & points_at(const IPointer &ip)
int remove_item(const K &rkey, int quiet=0)
remove key and val pair from list
void move_pointer_forwards(IPointer &ip) const
EST_String error_name(const EST_Features &a)
EST_TKVL< EST_String, EST_Val >::RwEntries i
void merge_features(EST_Features &to, EST_Features &from)
EST_write_status save(ostream &outf) const
save features in already opened ostream
EST_TStructIterator< EST_Features, IPointer, Entry > Entries
EST_TRwStructIterator< EST_Features, IPointer, Entry > RwEntries
bool operator==(const EST_Features &a, const EST_Features &b)
int add_item(const K &rkey, const V &rval, int no_search=0)
add key-val pair to list
EST_String & operator=(const char *str)
Assign C string to EST_String.
const EST_String S(const EST_String &path, const EST_String &def) const
EST_Features & A(const EST_String &path) const
int length() const
number of key value pairs in list
static EST_Val feature_default_value
int I(const EST_String &path) const
float F(const EST_String &path) const
EST_TKVI< EST_String, EST_Val > Entry
ostream & operator<<(ostream &st, const EST_FeatureData &d)