<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>class EST_Discrete</TITLE> <META NAME="GENERATOR" CONTENT="DOC++ 3.4.6"> </HEAD> <body bgcolor="#ffffff" link="#0000ff" vlink="#dd0000" text="#000088" alink="9000ff"> <A HREF = "http://www.cstr.ed.ac.uk/"> <IMG align=left BORDER=0 SRC = "cstr.gif"></A> <A HREF="http://www.cstr.ed.ac.uk/projects/speech_tools.html"> <IMG BORDER=0 ALIGN=right SRC="est.jpg" width=150 height=93></A> <br> <br clear=left> <p align=right> In file ../include/EST_simplestats.h:<TABLE BORDER=0><TR> <TD VALIGN=TOP><H2>class <A HREF="#DOC.DOCU">EST_Discrete</A></H2></TD></H2></TD></TR></TABLE> <BLOCKQUOTE>A class for managing mapping string names to integers and back again, mainly used for representing alphabets in n-grams and grammars etc.</BLOCKQUOTE> <HR> <DL> <P><TABLE> <DT><H3>Public Methods</H3><DD><TR> <TD VALIGN=TOP><A HREF="#DOC.83.1"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> </TD><TD><B>EST_Discrete</B> ()<BR> <I></I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.83.2"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> </TD><TD><B>EST_Discrete</B> (const <!1><A HREF="EST_Discrete.html#DOC.83.2">EST_Discrete</A> &<!1><A HREF="EST_SCFG_traintest.html#DOC.106.4">d</A>)<BR> <I></I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.83.3"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> </TD><TD><B>EST_Discrete</B> (const EST_StrList &vocab)<BR> <I>Initialise discrete class from given list of strings</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.83.4"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> </TD><TD><B>~EST_Discrete</B> ()<BR> <I></I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.83.5"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>void </TD><TD><B>copy</B> (const <!1><A HREF="EST_Discrete.html">EST_Discrete</A> &<!1><A HREF="EST_SCFG_traintest.html#DOC.106.4">d</A>)<BR> <I></I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.83.6"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>bool </TD><TD><B>init</B> (const EST_StrList &vocab)<BR> <I>(re-)initialise</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.83.7"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>const int </TD><TD><B>length</B> (void) const <BR> <I>The number of members in the discrete</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.83.8"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>const int </TD><TD><B>index</B> (const <!1><A HREF="EST_String.html">EST_String</A> &<!1><A HREF="EST_TVector.html#DOC.15.1.20.3">n</A>) const <BR> <I>The int assigned to the given name, if it doesn't exists p_def_val is returned (which is -1 by default)</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.83.9"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>const <!1><A HREF="EST_String.html">EST_String</A>& </TD><TD><B>name</B> (const int <!1><A HREF="EST_TVector.html#DOC.15.1.20.3">n</A>) const <BR> <I>The name given the index</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.83.10"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>void </TD><TD><B>def_val</B> (const <!1><A HREF="EST_String.html">EST_String</A> &<!1><A HREF="EST_Hash_Pair.html#DOC.91.2.2">v</A>)<BR> <I>set the default value when a name isn't found (-1 by default)</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.83.11"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>int </TD><TD><B>name</B> (const <!1><A HREF="EST_String.html">EST_String</A> &<!1><A HREF="EST_TVector.html#DOC.15.1.20.3">n</A>) const <BR> <I>An alternative method for getting the int form the name</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.83.12"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A><!1><A HREF="EST_Discrete.html">EST_Discrete</A>& </TD><TD><B>operator = </B> (const <!1><A HREF="EST_Discrete.html">EST_Discrete</A> &<!1><A HREF="EST_Wave.html#DOC.81.4.1">a</A>)<BR> <I></I> </TD></TR></TABLE></P> </DL> <A NAME="DOC.DOCU"></A> <HR> <H2>Documentation</H2> <BLOCKQUOTE>A class for managing mapping string names to integers and back again, mainly used for representing alphabets in n-grams and grammars etc. <P>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. <P></BLOCKQUOTE> <DL> <A NAME="EST_Discrete"></A> <A NAME="DOC.83.1"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> EST_Discrete()</B></TT> <DL><DT><DD></DL><P> <A NAME="EST_Discrete"></A> <A NAME="DOC.83.2"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> EST_Discrete(const <!1><A HREF="EST_Discrete.html#DOC.83.2">EST_Discrete</A> &<!1><A HREF="EST_SCFG_traintest.html#DOC.106.4">d</A>)</B></TT> <DL><DT><DD></DL><P> <A NAME="EST_Discrete"></A> <A NAME="DOC.83.3"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> EST_Discrete(const EST_StrList &vocab)</B></TT> <DD>Initialise discrete class from given list of strings <DL><DT><DD></DL><P> <A NAME="~EST_Discrete"></A> <A NAME="DOC.83.4"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> ~EST_Discrete()</B></TT> <DL><DT><DD></DL><P> <A NAME="copy"></A> <A NAME="DOC.83.5"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void copy(const <!1><A HREF="EST_Discrete.html">EST_Discrete</A> &<!1><A HREF="EST_SCFG_traintest.html#DOC.106.4">d</A>)</B></TT> <DL><DT><DD></DL><P> <A NAME="init"></A> <A NAME="DOC.83.6"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>bool init(const EST_StrList &vocab)</B></TT> <DD>(re-)initialise <DL><DT><DD></DL><P> <A NAME="length"></A> <A NAME="DOC.83.7"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>const int length(void) const </B></TT> <DD>The number of members in the discrete <DL><DT><DD></DL><P> <A NAME="index"></A> <A NAME="DOC.83.8"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>const int index(const <!1><A HREF="EST_String.html">EST_String</A> &<!1><A HREF="EST_TVector.html#DOC.15.1.20.3">n</A>) const </B></TT> <DD>The int assigned to the given name, if it doesn't exists p_def_val is returned (which is -1 by default) <DL><DT><DD></DL><P> <A NAME="name"></A> <A NAME="DOC.83.9"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>const <!1><A HREF="EST_String.html">EST_String</A>& name(const int <!1><A HREF="EST_TVector.html#DOC.15.1.20.3">n</A>) const </B></TT> <DD>The name given the index <DL><DT><DD></DL><P> <A NAME="def_val"></A> <A NAME="DOC.83.10"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void def_val(const <!1><A HREF="EST_String.html">EST_String</A> &<!1><A HREF="EST_Hash_Pair.html#DOC.91.2.2">v</A>)</B></TT> <DD>set the default value when a name isn't found (-1 by default) <DL><DT><DD></DL><P> <A NAME="name"></A> <A NAME="DOC.83.11"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int name(const <!1><A HREF="EST_String.html">EST_String</A> &<!1><A HREF="EST_TVector.html#DOC.15.1.20.3">n</A>) const </B></TT> <DD>An alternative method for getting the int form the name <DL><DT><DD></DL><P> <A NAME="operator = "></A> <A NAME="DOC.83.12"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="EST_Discrete.html">EST_Discrete</A>& operator = (const <!1><A HREF="EST_Discrete.html">EST_Discrete</A> &<!1><A HREF="EST_Wave.html#DOC.81.4.1">a</A>)</B></TT> <DL><DT><DD></DL><P></DL> <HR><DL><DT><B>This class has no child classes.</B></DL> <DL><DT><DT><B>Friends:</B><DD> ostream& operator <<(ostream& s, const <!1><A HREF="EST_Discrete.html">EST_Discrete</A> &<!1><A HREF="EST_SCFG_traintest.html#DOC.106.4">d</A>)<BR><DT><B>Author:</B><DD>Alan W Black (awb@cstr.ed.ac.uk): July 1996 <DD></DL><P><P><I><A HREF="index.html">Alphabetic index</A></I> <I><A HREF="HIER.html">HTML hierarchy of classes</A> or <A HREF="HIERjava.html">Java</A></I></P><HR> <A HREF = "http://www.ed.ac.uk/"> <IMG align=right BORDER=0 SRC = "edcrest.gif"></A> <P Align=left><I>This page is part of the <A HREF="http://www.cstr.ed.ac.uk/projects/speech_tools.html"> Edinburgh Speech Tools Library</A> documentation <br> Copyright <A HREF="http://www.ed.ac.uk"> University of Edinburgh</A> 1997 <br> Contact: <A HREF="mailto:speech_toolss@cstr.ed.ac.uk"> speech_tools@cstr.ed.ac.uk </a> </P> <br clear=right>