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

  | Access functions which return EST_Val.
  const EST_Val& | val (const char* name) const Look up directly without decomposing name as path (just simple feature)
  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
  const EST_Val& | val_path (const EST_String &path) const Look up feature name, which may be simple feature or path
  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
  const EST_Val& | operator() (const EST_String &path) const Look up feature name, which may be simple feature or path
  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
  const EST_Val& | f (const EST_String &path) Look up feature name, which may be simple feature or path
  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
  | Access functions which return types.
  const float | F (const EST_String &path) const Look up feature name, which may be simple feature or path, and return as a float
  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
  const int | I (const EST_String &path) const Look up feature name, which may be simple feature or path, and return as an int
  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
  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
  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
  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
  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
  | Setting features
  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>
  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>
  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>
  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>
  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>
  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>.
  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
  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
  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.
  | Utility functions
  void | remove (const EST_String &name) remove the named feature
  int | length () const number of features in feature structure
  int | present (const EST_String &name) const return 1 if the feature is present
  void | clear () Delete all features from object
  EST_Features& | operator = (const EST_Features& a) Feature assignment
  | f.save (s)
  | 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

## Documentation

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

`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`
    Look up directly without decomposing name as path (just simple feature)

  `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

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

  `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

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

  `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

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

  `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

`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").

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

  `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

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

  `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

  `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

  `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

  `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

  `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

`Setting features`

`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>

`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>

`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>

`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>

`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>

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

`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

`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

`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. The information in <parameter>f</parameter> is copied into the features.

`Utility functions`

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

`void remove(const EST_String &name)`
  remove the named feature

`int length() const`
  number of features in feature structure

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

`void clear()`
  Delete all features from object

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

`f.save(s)`

`Iteration`

`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

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