#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 () | |
EST_Features (const EST_Features &f) | |
~EST_Features () | |
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"). | |
float | F (const EST_String &path) const |
float | F (const EST_String &path, float def) const |
int | I (const EST_String &path) 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 More... | |
EST_read_status | load_sexpr (EST_TokenStream &ts) |
load features from sexpression, contained in already opened EST_TokenStream More... | |
EST_write_status | save (ostream &outf) const |
save features in already opened ostream More... | |
EST_write_status | save_sexpr (ostream &outf) const |
save features as s-expression in already opened ostream More... | |
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 63 of file EST_Features.h.
typedef EST_TKVI<EST_String, EST_Val> EST_Features::Entry |
Definition at line 303 of file EST_Features.h.
Definition at line 304 of file EST_Features.h.
Definition at line 305 of file EST_Features.h.
EST_Features::EST_Features | ( | ) |
Definition at line 53 of file EST_Features.cc.
EST_Features::EST_Features | ( | const EST_Features & | f | ) |
Definition at line 58 of file EST_Features.cc.
EST_Features::~EST_Features | ( | ) |
Definition at line 64 of file EST_Features.cc.
|
protected |
Definition at line 56 of file EST_features_io.cc.
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 def
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 def
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 104 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path, returning def
if not found
Definition at line 110 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path.
Definition at line 115 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path, returning def
if not found
Definition at line 121 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 136 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path, and return as a float, returning def
if not found
Definition at line 142 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 147 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path, and return as an int, returning def
if not found
Definition at line 153 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 158 of file EST_Features.h.
|
inline |
Look up feature name, which may be simple feature or path, and return as a EST_String, returning def
if not found
Definition at line 165 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 170 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 def
if not found
Definition at line 140 of file EST_Features.cc.
|
inline |
Add a new feature or set an existing feature name
to value ival
Definition at line 186 of file EST_Features.h.
|
inline |
Add a new feature or set an existing feature name
to value fval
Definition at line 192 of file EST_Features.h.
|
inline |
Add a new feature or set an existing feature name
to value dval
Definition at line 198 of file EST_Features.h.
|
inline |
Add a new feature or set an existing feature name
to value sval
Definition at line 204 of file EST_Features.h.
|
inline |
Add a new feature or set an existing feature name
to value cval
Definition at line 210 of file EST_Features.h.
|
inline |
Add a new feature or set an existing feature name
to value val
. Name
must be not be a path.
Definition at line 217 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 name
to value val
, where name
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 name
to value f
, which is the named of a registered feature function.
Definition at line 48 of file EST_features_io.cc.
|
inline |
Add a new feature or set an existing feature name
to value f
, which itself is a EST_Features. The information in f
is copied into the features.
Definition at line 236 of file EST_Features.h.
|
inline |
remove the named feature
Definition at line 247 of file EST_Features.h.
|
inline |
number of features in feature structure
Definition at line 251 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 257 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.
|
inlineprotected |
Definition at line 283 of file EST_Features.h.
|
inlineprotected |
Definition at line 285 of file EST_Features.h.
Definition at line 287 of file EST_Features.h.
|
inlineprotected |
Definition at line 289 of file EST_Features.h.
EST_read_status EST_Features::load | ( | EST_TokenStream & | ts | ) |
load features from already opened EST_TokenStream
Definition at line 250 of file EST_features_io.cc.
EST_read_status EST_Features::load_sexpr | ( | EST_TokenStream & | ts | ) |
load features from sexpression, contained in already opened EST_TokenStream
Definition at line 181 of file EST_features_io.cc.
EST_write_status EST_Features::save | ( | ostream & | outf | ) | const |
save features in already opened ostream
Definition at line 113 of file EST_features_io.cc.
EST_write_status EST_Features::save_sexpr | ( | ostream & | outf | ) | const |
save features as s-expression in already opened ostream
Definition at line 127 of file EST_features_io.cc.
|
friend |
Definition at line 292 of file EST_Features.h.
|
friend |
Definition at line 293 of file EST_Features.h.
|
friend |
Definition at line 294 of file EST_Features.h.
|
friend |
Definition at line 295 of file EST_Features.h.
|
friend |
Print Features
Definition at line 262 of file EST_Features.h.
|
protected |
Definition at line 65 of file EST_Features.h.
|
static |
Definition at line 71 of file EST_Features.h.