In file ../include/EST_simplestats.h:

class EST_Discrete

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

Public Methods

[more] EST_Discrete ()
[more] EST_Discrete (const EST_Discrete &d)
[more] EST_Discrete (const EST_StrList &vocab)
Initialise discrete class from given list of strings
[more] ~EST_Discrete ()
[more]void copy (const EST_Discrete &d)
[more]bool init (const EST_StrList &vocab)
(re-)initialise
[more]const int length (void) const
The number of members in the discrete
[more]const int index (const EST_String &n) const
The int assigned to the given name, if it doesn't exists p_def_val is returned (which is -1 by default)
[more]const EST_String& name (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]EST_Discrete& operator = (const EST_Discrete &a)


Documentation

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.

o EST_Discrete()

o EST_Discrete(const EST_Discrete &d)

o EST_Discrete(const EST_StrList &vocab)
Initialise discrete class from given list of strings

o ~EST_Discrete()

ovoid copy(const EST_Discrete &d)

obool init(const EST_StrList &vocab)
(re-)initialise

oconst int length(void) const
The number of members in the discrete

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

oconst EST_String& name(const int n) const
The name given the index

ovoid def_val(const EST_String &v)
set the default value when a name isn't found (-1 by default)

oint name(const EST_String &n) const
An alternative method for getting the int form the name

oEST_Discrete& operator = (const EST_Discrete &a)


This class has no child classes.
Friends:
ostream& operator <<(ostream& s, const EST_Discrete &d)
Author:
Alan W Black (awb@cstr.ed.ac.uk): July 1996

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