#include <include/EST_Features.h>
Classes | |
struct | IPointer |
Public Types | |
Iteration | |
typedef EST_TKVI< EST_String, EST_Val > | Entry |
typedef EST_TStructIterator < EST_Features, IPointer, Entry > | Entries |
typedef EST_TRwStructIterator < EST_Features, IPointer, Entry > | RwEntries |
Public Member Functions | |
EST_Features (const EST_Features &f) | |
Access functions which return EST_Val. | |
Features can either be simple features, in which their name is the name of an plain attribute (e.g. "name"), or path features where their name is a dot separated path of concatenated attributes (e.g. "df.poa.alveolar"). | |
const EST_Val & | val (const char *name) const |
const EST_Val & | val (const char *name, const EST_Val &def) const |
const EST_Val & | val_path (const EST_String &path) const |
const EST_Val & | val_path (const EST_String &path, const EST_Val &def) const |
const EST_Val & | operator() (const EST_String &path) const |
const EST_Val & | operator() (const EST_String &path, const EST_Val &def) const |
const EST_Val & | f (const EST_String &path) const |
const EST_Val & | f (const EST_String &path, const EST_Val &def) const |
Access functions which return types. | |
These functions cast their EST_Val return value to a requested type, either float, int, string or features (A). In all cases the name can be a simple feature or a path, in which case their name is a dot separated string of concatenated attributes (e.g. "df.poa.alveolar"). | |
const float | F (const EST_String &path) const |
const float | F (const EST_String &path, float def) const |
const int | I (const EST_String &path) const |
const int | I (const EST_String &path, int def) const |
const EST_String | S (const EST_String &path) const |
const EST_String | S (const EST_String &path, const EST_String &def) const |
EST_Features & | A (const EST_String &path) const |
EST_Features & | A (const EST_String &path, EST_Features &def) const |
Setting features | |
void | set (const EST_String &name, int ival) |
void | set (const EST_String &name, float fval) |
void | set (const EST_String &name, double dval) |
void | set (const EST_String &name, const EST_String &sval) |
void | set (const EST_String &name, const char *cval) |
void | set_val (const EST_String &name, const EST_Val &sval) |
void | set_path (const EST_String &name, const EST_Val &sval) |
void | set_function (const EST_String &name, const EST_String &f) |
void | set (const EST_String &name, EST_Features &f) |
File I/O | |
EST_read_status | load (EST_TokenStream &ts) |
load features from already opened EST_TokenStream | |
EST_read_status | load_sexpr (EST_TokenStream &ts) |
load features from sexpression, contained in already opened EST_TokenStream | |
EST_write_status | save (ostream &outf) const |
save features in already opened ostream | |
EST_write_status | save_sexpr (ostream &outf) const |
save features as s-expression in already opened ostream | |
Static Public Attributes | |
static EST_Val | feature_default_value |
Protected Member Functions | |
void | save_fpair (ostream &outf, const EST_String &fname, const EST_Val &fvalue) const |
void | point_to_first (IPointer &ip) const |
void | move_pointer_forwards (IPointer &ip) const |
bool | points_to_something (const IPointer &ip) const |
EST_TKVI< EST_String, EST_Val > & | points_at (const IPointer &ip) |
Protected Attributes | |
EST_TKVL< EST_String, EST_Val > * | features |
Utility functions | |
ostream & | operator<< (ostream &s, const EST_Features &f) |
void | remove (const EST_String &name) |
int | length () const |
int | present (const EST_String &name) const |
void | clear () |
EST_Features & | operator= (const EST_Features &a) |
A class for containing feature structures which can hold atomic
values (int, float, string) or other feature structures.
Definition at line 62 of file EST_Features.h.
const EST_Val & EST_Features::val | ( | const char * | name | ) | const |
Look up directly without decomposing name as path (just simple feature)
Definition at line 87 of file EST_Features.cc.
Look up directly without decomposing name as path (just simple feature),
returning <parameter>def</parameter> if not found
Definition at line 73 of file EST_Features.cc.
const EST_Val & EST_Features::val_path | ( | const EST_String & | path | ) | const |
Look up feature name, which may be simple feature or path
Definition at line 121 of file EST_Features.cc.
const EST_Val & EST_Features::val_path | ( | const EST_String & | path, |
const EST_Val & | def | ||
) | const |
Look up feature name, which may be simple feature or path,
returning <parameter>def</parameter> if not found
Definition at line 103 of file EST_Features.cc.
|
inline |
Look up feature name, which may be simple feature or path.
Definition at line 103 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path,
returning <parameter>def</parameter> if not found
Definition at line 109 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path.
Definition at line 114 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path,
returning <parameter>def</parameter> if not found
Definition at line 120 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path, and return
as a float
Definition at line 135 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path, and
return as a float, returning <parameter>def</parameter> if not found
Definition at line 141 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path, and return
as an int
Definition at line 146 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path, and
return as an int, returning <parameter>def</parameter> if not found
Definition at line 152 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path, and return
as a EST_String
Definition at line 157 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path, and
return as a EST_String, returning <parameter>def</parameter> if not found
Definition at line 164 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path, and return
as a EST_Features
Definition at line 169 of file EST_Features.h.
EST_Features & EST_Features::A | ( | const EST_String & | path, |
EST_Features & | def | ||
) | const |
Look up feature name, which may be simple feature or path, and
return as a EST_Features, returning <parameter>def</parameter> if not found
Definition at line 140 of file EST_Features.cc.
|
inline |
Add a new feature or set an existing feature <parameter>name<parameter>
to value <parameter>ival</parameter>
Definition at line 185 of file EST_Features.h.
|
inline |
Add a new feature or set an existing feature <parameter>name<parameter>
to value <parameter>fval</parameter>
Definition at line 191 of file EST_Features.h.
|
inline |
Add a new feature or set an existing feature <parameter>name<parameter>
to value <parameter>dval</parameter>
Definition at line 197 of file EST_Features.h.
|
inline |
Add a new feature or set an existing feature <parameter>name<parameter>
to value <parameter>sval</parameter>
Definition at line 203 of file EST_Features.h.
|
inline |
Add a new feature or set an existing feature <parameter>name<parameter>
to value <parameter>cval</parameter>
Definition at line 209 of file EST_Features.h.
|
inline |
Add a new feature or set an existing feature <parameter>name<parameter>
to value <parameter>val<parameter>. <parameter>Name<parameter> must be not be a path.
Definition at line 216 of file EST_Features.h.
void EST_Features::set_path | ( | const EST_String & | name, |
const EST_Val & | sval | ||
) |
Add a new feature or set an existing feature <parameter>name<parameter>
to value <parameter>val<parameter>, where <parameter>name<parameter> is a path.
Definition at line 164 of file EST_Features.cc.
void EST_Features::set_function | ( | const EST_String & | name, |
const EST_String & | f | ||
) |
Add a new feature feature or set an existing feature
<parameter>name<parameter> to value <parameter>f</parameter>, which is the named of a registered feature function.
Definition at line 46 of file EST_features_io.cc.
|
inline |
Add a new feature or set an existing feature
<parameter>name<parameter> to value <parameter>f</parameter>, which itself is a EST_Features. The information in <parameter>f</parameter> is copied into the features.
Definition at line 235 of file EST_Features.h.
|
inline |
remove the named feature
Definition at line 246 of file EST_Features.h.
|
inline |
number of features in feature structure
Definition at line 250 of file EST_Features.h.
int EST_Features::present | ( | const EST_String & | name | ) | const |
return 1 if the feature is present
Definition at line 147 of file EST_Features.cc.
|
inline |
Delete all features from object
Definition at line 256 of file EST_Features.h.
EST_Features & EST_Features::operator= | ( | const EST_Features & | a | ) |
Feature assignment
Definition at line 192 of file EST_Features.cc.
|
friend |
Print Features
Definition at line 261 of file EST_Features.h.