Edinburgh Speech Tools 2.4-release
EST_Features Class Reference

#include <include/EST_Features.h>

Collaboration diagram for EST_Features:

Classes

struct  IPointer
 

Public Types

Iteration
typedef EST_TKVI< EST_String, EST_ValEntry
 
typedef EST_TStructIterator< EST_Features, IPointer, EntryEntries
 
typedef EST_TRwStructIterator< EST_Features, IPointer, EntryRwEntries
 

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_Valval (const char *name) const
 
const EST_Valval (const char *name, const EST_Val &def) const
 
const EST_Valval_path (const EST_String &path) const
 
const EST_Valval_path (const EST_String &path, const EST_Val &def) const
 
const EST_Valoperator() (const EST_String &path) const
 
const EST_Valoperator() (const EST_String &path, const EST_Val &def) const
 
const EST_Valf (const EST_String &path) const
 
const EST_Valf (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_FeaturesA (const EST_String &path) const
 
EST_FeaturesA (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
 

Protected Attributes

EST_TKVL< EST_String, EST_Val > * features
 

Utility functions

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 > >
 
ostream & operator<< (ostream &s, const EST_Features &f)
 
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)
 
void remove (const EST_String &name)
 
int length () const
 
int present (const EST_String &name) const
 
void clear ()
 
EST_Featuresoperator= (const EST_Features &a)
 

Detailed Description

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.

Member Typedef Documentation

◆ Entry

Definition at line 302 of file EST_Features.h.

◆ Entries

◆ RwEntries

Constructor & Destructor Documentation

◆ EST_Features() [1/2]

EST_Features::EST_Features ( )

Definition at line 53 of file EST_Features.cc.

◆ EST_Features() [2/2]

EST_Features::EST_Features ( const EST_Features f)

Definition at line 58 of file EST_Features.cc.

◆ ~EST_Features()

EST_Features::~EST_Features ( )

Definition at line 64 of file EST_Features.cc.

Member Function Documentation

◆ save_fpair()

void EST_Features::save_fpair ( ostream &  outf,
const EST_String fname,
const EST_Val fvalue 
) const
protected

Definition at line 54 of file EST_features_io.cc.

◆ val() [1/2]

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.

◆ val() [2/2]

const EST_Val & EST_Features::val ( const char *  name,
const EST_Val def 
) const

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.

◆ val_path() [1/2]

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.

◆ val_path() [2/2]

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.

◆ operator()() [1/2]

const EST_Val & EST_Features::operator() ( const EST_String path) const
inline

Look up feature name, which may be simple feature or path.

Definition at line 103 of file EST_Features.h.

◆ operator()() [2/2]

const EST_Val & EST_Features::operator() ( const EST_String path,
const EST_Val def 
) const
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.

◆ f() [1/2]

const EST_Val & EST_Features::f ( const EST_String path) const
inline

Look up feature name, which may be simple feature or path.

Definition at line 114 of file EST_Features.h.

◆ f() [2/2]

const EST_Val & EST_Features::f ( const EST_String path,
const EST_Val def 
) const
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.

◆ F() [1/2]

const float EST_Features::F ( const EST_String path) const
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.

◆ F() [2/2]

const float EST_Features::F ( const EST_String path,
float  def 
) const
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.

◆ I() [1/2]

const int EST_Features::I ( const EST_String path) const
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.

◆ I() [2/2]

const int EST_Features::I ( const EST_String path,
int  def 
) const
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.

◆ S() [1/2]

const EST_String EST_Features::S ( const EST_String path) const
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.

◆ S() [2/2]

const EST_String EST_Features::S ( const EST_String path,
const EST_String def 
) const
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.

◆ A() [1/2]

EST_Features & EST_Features::A ( const EST_String path) const
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.

◆ A() [2/2]

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.

◆ set() [1/6]

void EST_Features::set ( const EST_String name,
int  ival 
)
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.

◆ set() [2/6]

void EST_Features::set ( const EST_String name,
float  fval 
)
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.

◆ set() [3/6]

void EST_Features::set ( const EST_String name,
double  dval 
)
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.

◆ set() [4/6]

void EST_Features::set ( const EST_String name,
const EST_String sval 
)
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.

◆ set() [5/6]

void EST_Features::set ( const EST_String name,
const char *  cval 
)
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.

◆ set_val()

void EST_Features::set_val ( const EST_String name,
const EST_Val sval 
)
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.

◆ set_path()

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.

◆ set_function()

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.

◆ set() [6/6]

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

◆ remove()

void EST_Features::remove ( const EST_String name)
inline

remove the named feature

Definition at line 246 of file EST_Features.h.

◆ length()

int EST_Features::length ( ) const
inline

number of features in feature structure

Definition at line 250 of file EST_Features.h.

◆ present()

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.

◆ clear()

void EST_Features::clear ( )
inline

Delete all features from object

Definition at line 256 of file EST_Features.h.

◆ operator=()

EST_Features & EST_Features::operator= ( const EST_Features a)

Feature assignment

Definition at line 192 of file EST_Features.cc.

◆ point_to_first()

void EST_Features::point_to_first ( IPointer ip) const
inlineprotected

Definition at line 282 of file EST_Features.h.

◆ move_pointer_forwards()

void EST_Features::move_pointer_forwards ( IPointer ip) const
inlineprotected

Definition at line 284 of file EST_Features.h.

◆ points_to_something()

bool EST_Features::points_to_something ( const IPointer ip) const
inlineprotected

Definition at line 286 of file EST_Features.h.

◆ points_at()

EST_TKVI< EST_String, EST_Val > & EST_Features::points_at ( const IPointer ip)
inlineprotected

Definition at line 288 of file EST_Features.h.

◆ load()

EST_read_status EST_Features::load ( EST_TokenStream ts)

load features from already opened EST_TokenStream

Definition at line 248 of file EST_features_io.cc.

◆ load_sexpr()

EST_read_status EST_Features::load_sexpr ( EST_TokenStream ts)

load features from sexpression, contained in already opened EST_TokenStream

Definition at line 179 of file EST_features_io.cc.

◆ save()

EST_write_status EST_Features::save ( ostream &  outf) const

save features in already opened ostream

Definition at line 111 of file EST_features_io.cc.

◆ save_sexpr()

EST_write_status EST_Features::save_sexpr ( ostream &  outf) const

save features as s-expression in already opened ostream

Definition at line 125 of file EST_features_io.cc.

Friends And Related Function Documentation

◆ EST_TIterator< EST_Features, IPointer, EST_TKVI< EST_String, EST_Val > >

Definition at line 288 of file EST_Features.h.

◆ EST_TStructIterator< EST_Features, IPointer, EST_TKVI< EST_String, EST_Val > >

Definition at line 288 of file EST_Features.h.

◆ EST_TRwIterator< EST_Features, IPointer, EST_TKVI< EST_String, EST_Val > >

Definition at line 288 of file EST_Features.h.

◆ EST_TRwStructIterator< EST_Features, IPointer, EST_TKVI< EST_String, EST_Val > >

Definition at line 288 of file EST_Features.h.

◆ operator<<

ostream & operator<< ( ostream &  s,
const EST_Features f 
)
friend

Print Features

Definition at line 261 of file EST_Features.h.

Member Data Documentation

◆ features

EST_TKVL<EST_String, EST_Val>* EST_Features::features
protected

Definition at line 64 of file EST_Features.h.

◆ feature_default_value

EST_Val EST_Features::feature_default_value
static

Definition at line 70 of file EST_Features.h.


The documentation for this class was generated from the following files: