Edinburgh Speech Tools  2.1-release
EST_Discrete Class Reference

#include <include/EST_simplestats.h>

Public Member Functions

 EST_Discrete ()
 
 EST_Discrete (const EST_Discrete &d)
 
 EST_Discrete (const EST_StrList &vocab)
 Initialise discrete class from given list of strings. More...
 
 ~EST_Discrete ()
 
void copy (const EST_Discrete &d)
 
bool init (const EST_StrList &vocab)
 (re-)initialise More...
 
int length (void) const
 The number of members in the discrete. More...
 
int index (const EST_String &n) const
 
const EST_Stringname (const int n) const
 The name given the index. More...
 
void def_val (const EST_String &v)
 set the default value when a name isn't found (-1 by default) More...
 
int name (const EST_String &n) const
 An alternative method for getting the int form the name. More...
 
bool operator== (const EST_Discrete &d)
 
bool operator!= (const EST_Discrete &d)
 
EST_String print_to_string (int quote=0)
 
EST_Discreteoperator= (const EST_Discrete &a)
 

Friends

ostream & operator<< (ostream &s, const EST_Discrete &d)
 

Detailed Description

A class for managing mapping string names to integers and back again, mainly used for representing alphabets in n-grams and grammars etc.

This offers an efficient way of mapping a known set of string names to integers. It is initialised from a list of names and builds a index of those names to a set of integers.

Author
Alan W Black (awb@c.nosp@m.str..nosp@m.ed.ac.nosp@m..uk): July 1996

Definition at line 61 of file EST_simplestats.h.

Constructor & Destructor Documentation

EST_Discrete::EST_Discrete ( )
inline

Definition at line 71 of file EST_simplestats.h.

EST_Discrete::EST_Discrete ( const EST_Discrete d)
inline

Definition at line 73 of file EST_simplestats.h.

EST_Discrete::EST_Discrete ( const EST_StrList vocab)

Initialise discrete class from given list of strings.

Definition at line 57 of file EST_Discrete.cc.

EST_Discrete::~EST_Discrete ( )

Definition at line 52 of file EST_Discrete.cc.

Member Function Documentation

void EST_Discrete::copy ( const EST_Discrete d)

Definition at line 67 of file EST_Discrete.cc.

bool EST_Discrete::init ( const EST_StrList vocab)

(re-)initialise

Definition at line 82 of file EST_Discrete.cc.

int EST_Discrete::length ( void  ) const
inline

The number of members in the discrete.

Definition at line 84 of file EST_simplestats.h.

int EST_Discrete::index ( const EST_String n) const
inline

The int assigned to the given name, if it doesn't exists p_def_val is returned (which is -1 by default)

Definition at line 88 of file EST_simplestats.h.

const EST_String& EST_Discrete::name ( const int  n) const
inline

The name given the index.

Definition at line 94 of file EST_simplestats.h.

void EST_Discrete::def_val ( const EST_String v)
inline

set the default value when a name isn't found (-1 by default)

Definition at line 97 of file EST_simplestats.h.

int EST_Discrete::name ( const EST_String n) const
inline

An alternative method for getting the int form the name.

Definition at line 100 of file EST_simplestats.h.

bool EST_Discrete::operator== ( const EST_Discrete d)

Definition at line 112 of file EST_Discrete.cc.

bool EST_Discrete::operator!= ( const EST_Discrete d)

Definition at line 119 of file EST_Discrete.cc.

EST_String EST_Discrete::print_to_string ( int  quote = 0)

Definition at line 124 of file EST_Discrete.cc.

EST_Discrete& EST_Discrete::operator= ( const EST_Discrete a)
inline

Definition at line 109 of file EST_simplestats.h.

Friends And Related Function Documentation

ostream& operator<< ( ostream &  s,
const EST_Discrete d 
)
friend

Definition at line 143 of file EST_Discrete.cc.


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