In file ../include/EST_Features.h:

class EST_Features

A class for containing feature structures which can hold atomic values (int, float, string) or other feature structures

Public Methods

[more] Access functions which return EST_Val.

[more]const EST_Val& val (const char* name) const
Look up directly without decomposing name as path (just simple feature)
[more]const EST_Val& val (const char* name, const EST_Val &def) const
Look up directly without decomposing name as path (just simple feature), returning <parameter>def</paramater> if not found
[more]const EST_Val& val_path (const EST_String &path) const
Look up feature name, which may be simple feature or path
[more]const EST_Val& 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</paramater> if not found
[more]const EST_Val& operator() (const EST_String &path) const
Look up feature name, which may be simple feature or path
[more]const EST_Val& operator() (const EST_String &path, const EST_Val &def) const
Look up feature name, which may be simple feature or path, returning <parameter>def</paramater> if not found
[more]const EST_Val& f (const EST_String &path)
Look up feature name, which may be simple feature or path
[more]const EST_Val& f (const EST_String &path, const EST_Val &def)
Look up feature name, which may be simple feature or path, returning <parameter>def</paramater> if not found

[more] Access functions which return types.

[more]const float F (const EST_String &path) const
Look up feature name, which may be simple feature or path, and return as a float
[more]const float F (const EST_String &path, float def) const
Look up feature name, which may be simple feature or path, and return as a float, returning <parameter>def</paramater> if not found
[more]const int I (const EST_String &path) const
Look up feature name, which may be simple feature or path, and return as an int
[more]const int I (const EST_String &path, int def) const
Look up feature name, which may be simple feature or path, and return as an int, returning <parameter>def</paramater> if not found
[more]const EST_String S (const EST_String &path) const
Look up feature name, which may be simple feature or path, and return as a EST_String
[more]const EST_String S (const EST_String &path, const EST_String &def) const
Look up feature name, which may be simple feature or path, and return as a EST_String, returning <parameter>def</paramater> if not found
[more]EST_Features& A (const EST_String &path) const
Look up feature name, which may be simple feature or path, and return as a EST_Features
[more]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</paramater> if not found

[more] Setting features

[more]void set (const EST_String &name, int ival)
Add a new feature or set an existing feature <parameter>name<parameter> to value <parameter>ival</parameter>
[more]void set (const EST_String &name, float fval)
Add a new feature or set an existing feature <parameter>name<parameter> to value <parameter>fval</parameter>
[more]void set (const EST_String &name, double dval)
Add a new feature or set an existing feature <parameter>name<parameter> to value <parameter>dval</parameter>
[more]void set (const EST_String &name, const EST_String &sval)
Add a new feature or set an existing feature <parameter>name<parameter> to value <parameter>sval</parameter>
[more]void set (const EST_String &name, const char* cval)
Add a new feature or set an existing feature <parameter>name<parameter> to value <parameter>cval</parameter>
[more]void set_val (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>.
[more]void 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
[more]void 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
[more]void set (const EST_String &name, EST_Features &f)
Add a new feature or set an existing feature <parameter>name<parameter> to value <parameter>f</parameter>, which itself is a EST_Features.

[more] Utility functions

[more]void remove (const EST_String &name)
remove the named feature
[more]int length () const
number of features in feature structure
[more]int present (const EST_String &name) const
return 1 if the feature is present
[more]void clear ()
Delete all features from object
[more]EST_Features& operator = (const EST_Features& a)
Feature assignment
[more] f.save (s)

[more] File I/O

[more]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


Documentation

A class for containing feature structures which can hold atomic values (int, float, string) or other feature structures
o 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").

oconst EST_Val& val(const char* name) const
Look up directly without decomposing name as path (just simple feature)

oconst EST_Val& val(const char* name, const EST_Val &def) const
Look up directly without decomposing name as path (just simple feature), returning <parameter>def</paramater> if not found

oconst EST_Val& val_path(const EST_String &path) const
Look up feature name, which may be simple feature or path

oconst EST_Val& 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</paramater> if not found

oconst EST_Val& operator() (const EST_String &path) const
Look up feature name, which may be simple feature or path

oconst EST_Val& operator() (const EST_String &path, const EST_Val &def) const
Look up feature name, which may be simple feature or path, returning <parameter>def</paramater> if not found

oconst EST_Val& f(const EST_String &path)
Look up feature name, which may be simple feature or path

oconst EST_Val& f(const EST_String &path, const EST_Val &def)
Look up feature name, which may be simple feature or path, returning <parameter>def</paramater> if not found

o Access functions which return types.
These functions cast their EST_Val return value to a requested type, eithe 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").

oconst float F(const EST_String &path) const
Look up feature name, which may be simple feature or path, and return as a float

oconst float F(const EST_String &path, float def) const
Look up feature name, which may be simple feature or path, and return as a float, returning <parameter>def</paramater> if not found

oconst int I(const EST_String &path) const
Look up feature name, which may be simple feature or path, and return as an int

oconst int I(const EST_String &path, int def) const
Look up feature name, which may be simple feature or path, and return as an int, returning <parameter>def</paramater> if not found

oconst EST_String S(const EST_String &path) const
Look up feature name, which may be simple feature or path, and return as a EST_String

oconst EST_String S(const EST_String &path, const EST_String &def) const
Look up feature name, which may be simple feature or path, and return as a EST_String, returning <parameter>def</paramater> if not found

oEST_Features& A(const EST_String &path) const
Look up feature name, which may be simple feature or path, and return as a EST_Features

oEST_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</paramater> if not found

o Setting features

ovoid set(const EST_String &name, int ival)
Add a new feature or set an existing feature <parameter>name<parameter> to value <parameter>ival</parameter>

ovoid set(const EST_String &name, float fval)
Add a new feature or set an existing feature <parameter>name<parameter> to value <parameter>fval</parameter>

ovoid set(const EST_String &name, double dval)
Add a new feature or set an existing feature <parameter>name<parameter> to value <parameter>dval</parameter>

ovoid set(const EST_String &name, const EST_String &sval)
Add a new feature or set an existing feature <parameter>name<parameter> to value <parameter>sval</parameter>

ovoid set(const EST_String &name, const char* cval)
Add a new feature or set an existing feature <parameter>name<parameter> to value <parameter>cval</parameter>

ovoid set_val(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>. <parameter>Name<parameter> must be not be a path.

ovoid 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

ovoid 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

ovoid set(const EST_String &name, EST_Features &f)
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.

o Utility functions
Friends:
ostream& operator << (ostream &s, const EST_Features &f)

ovoid remove(const EST_String &name)
remove the named feature

oint length() const
number of features in feature structure

oint present(const EST_String &name) const
return 1 if the feature is present

ovoid clear()
Delete all features from object

oEST_Features& operator = (const EST_Features& a)
Feature assignment

o f.save(s)

o Iteration

o File I/O

oEST_read_status load(EST_TokenStream &ts)
load features from already opened EST_TokenStream

oEST_read_status load_sexpr(EST_TokenStream &ts)
load features from sexpression, contained in already opened EST_TokenStream

oEST_write_status save(ostream &outf) const
save features in already opened ostream

oEST_write_status save_sexpr(ostream &outf) const
save features as s-expression in already opened ostream


This class has no child classes.
Friends:
class EST_TIterator< EST_Features, IPointer, EST_TKVI<EST_String, EST_Val> >
class EST_TStructIterator< EST_Features, IPointer, EST_TKVI<EST_String, EST_Val> >
class EST_TRwIterator< EST_Features, IPointer, EST_TKVI<EST_String, EST_Val> >
class EST_TRwStructIterator< EST_Features, IPointer, EST_TKVI<EST_String, EST_Val> >

Alphabetic index HTML hierarchy of classes or Java


This page is part of the Edinburgh Speech Tools Library documentation
Copyright University of Edinburgh 1997
Contact: speech_tools@cstr.ed.ac.uk