Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 0e54ba0ee564ce6063a5e83aa86060c5 > files > 209

festival-speechtools-devel-1.2.96-18.fc14.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>
<HEAD>
   <TITLE>class  EST_SCFG</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_SCFG.h:<TABLE BORDER=0><TR>
<TD VALIGN=TOP><H2>class  <A HREF="#DOC.DOCU">EST_SCFG</A></H2></TD></H2></TD></TR></TABLE>
<BLOCKQUOTE>A class representing a stochastic context free grammar (SCFG).</BLOCKQUOTE>
<HR>

<H2>Inheritance:</H2>
<APPLET CODE="ClassGraph.class" WIDTH=600 HEIGHT=65>
<param name=classes value="CEST_SCFG,MEST_SCFG.html,CEST_SCFG_traintest,MEST_SCFG_traintest.html">
<param name=before value="M,M^_">
<param name=after value="M,M">
<param name=indent value="0,0">
<param name=arrowdir value="down">
</APPLET>
<HR>

<DL>
<P><TABLE>
<DT><H3>Public Methods</H3><DD><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.1"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> </TD><TD><B>Constructor and initialisation functions </B> <BR>
<I></I>
<P><TABLE>
<TR>
<TD VALIGN=TOP><A HREF="#DOC.105.1.1"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> </TD><TD><B>EST_SCFG</B> (LISP <!1><A HREF="EST_SCFG.html#DOC.105.2.3">rules</A>)<BR>
<I>Initialize from a set of rules</I>
</TD></TR></TABLE></P>
</TD></TR><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.2"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> </TD><TD><B>utility functions </B> <BR>
<I></I>
<P><TABLE>
<TR>
<TD VALIGN=TOP><A HREF="#DOC.105.2.1"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>void </TD><TD><B>set_rules</B> (LISP <!1><A HREF="EST_SCFG.html#DOC.105.2.3">rules</A>)<BR>
<I>Set (or reset) rules from external source after construction</I>
</TD></TR><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.2.2"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>LISP </TD><TD><B>get_rules</B> ()<BR>
<I>Return rules as LISP list</I>
</TD></TR><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.2.3"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>SCFGRuleList </TD><TD><B>rules</B> <BR>
<I>The rules themselves</I>
</TD></TR><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.2.4"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>void </TD><TD><B>find_terms_nonterms</B> (EST_StrList &amp;nt, EST_StrList &amp;<!1><A HREF="EST_Wave.html#DOC.81.4.5">t</A>, LISP <!1><A HREF="EST_SCFG.html#DOC.105.2.3">rules</A>)<BR>
<I>Find the terminals and nonterminals in the given grammar, adding them to the appropriate given string lists</I>
</TD></TR><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.2.5"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A><!1><A HREF="EST_String.html">EST_String</A> </TD><TD><B>nonterminal</B> (int <!1><A HREF="XML_Parser.html#DOC.190.3.9">p</A>) const <BR>
<I>Convert nonterminal index to string form</I>
</TD></TR><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.2.6"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A><!1><A HREF="EST_String.html">EST_String</A> </TD><TD><B>terminal</B> (int m) const <BR>
<I>Convert terminal index to string form</I>
</TD></TR><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.2.7"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>int </TD><TD><B>nonterminal</B> (const <!1><A HREF="EST_String.html">EST_String</A> &amp;<!1><A HREF="XML_Parser.html#DOC.190.3.9">p</A>) const <BR>
<I>Convert nonterminal string to index</I>
</TD></TR><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.2.8"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>int </TD><TD><B>terminal</B> (const <!1><A HREF="EST_String.html">EST_String</A> &amp;m) const <BR>
<I>Convert terminal string to index</I>
</TD></TR><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.2.9"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>int </TD><TD><B>num_nonterminals</B> () const <BR>
<I>Number of nonterminals</I>
</TD></TR><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.2.10"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>int </TD><TD><B>num_terminals</B> () const <BR>
<I>Number of terminals</I>
</TD></TR><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.2.11"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>double </TD><TD><B>prob_B</B> (int <!1><A HREF="XML_Parser.html#DOC.190.3.9">p</A>, int q, int r) const <BR>
<I>The rule probability of given binary rule</I>
</TD></TR><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.2.12"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>double </TD><TD><B>prob_U</B> (int <!1><A HREF="XML_Parser.html#DOC.190.3.9">p</A>, int m) const <BR>
<I>The rule probability of given unary rule</I>
</TD></TR><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.2.13"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>void </TD><TD><B>set_rule_prob_cache</B> ()<BR>
<I>(re-)set rule probability caches</I>
</TD></TR></TABLE></P>
</TD></TR><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.3"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> </TD><TD><B>file i/o functions </B> <BR>
<I></I>
<P><TABLE>
<TR>
<TD VALIGN=TOP><A HREF="#DOC.105.3.1"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A><!1><A HREF="EST_read_status.html">EST_read_status</A> </TD><TD><B>load</B> (const <!1><A HREF="EST_String.html">EST_String</A> &amp;<!1><A HREF="EST_TokenStream.html#DOC.10.7.9">filename</A>)<BR>
<I>Load grammar from named file</I>
</TD></TR><TR>
<TD VALIGN=TOP><A HREF="#DOC.105.3.2"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A><!1><A HREF="EST_write_status.html">EST_write_status</A> </TD><TD><B>save</B> (const <!1><A HREF="EST_String.html">EST_String</A> &amp;<!1><A HREF="EST_TokenStream.html#DOC.10.7.9">filename</A>)<BR>
<I>Save current grammar to named file</I>
</TD></TR></TABLE></P>
</TD></TR></TABLE></P>

</DL>

<A NAME="DOC.DOCU"></A>
<HR>
<H2>Documentation</H2>
<BLOCKQUOTE>A class representing a stochastic context free grammar (SCFG).

<P>This class includes the representation of the grammar itself and
methods for training and testing it against some corpus.

<P>At presnet of grammars in Chomsky Normal Form are supported.  That
is rules may be binary or unary.  If binary the mother an two
daughters are nonterminals, if unary the mother must be nonterminal
and daughter a terminal symbol.  

<P>The terminals and nonterminals symbol sets are derived automatically
from the LISP representation of the rules at initialization time
and are represented as <!1><A HREF="EST_Discrete.html">EST_Discrete</A>s.  The distinguished
symbol is assumed to be the first mother of the first rule in
the given grammar.
</BLOCKQUOTE>
<DL>

<A NAME="Constructor and initialisation functions "></A>
<A NAME="DOC.105.1"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> Constructor and initialisation functions </B></TT>
<DL><DT><DD></DL><P><DL>

<A NAME="EST_SCFG"></A>
<A NAME="DOC.105.1.1"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> EST_SCFG(LISP <!1><A HREF="EST_SCFG.html#DOC.105.2.3">rules</A>)</B></TT>
<DD>Initialize from a set of rules
<DL><DT><DD></DL><P></DL>

<A NAME="utility functions "></A>
<A NAME="DOC.105.2"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> utility functions </B></TT>
<DL><DT><DD></DL><P><DL>

<A NAME="set_rules"></A>
<A NAME="DOC.105.2.1"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void set_rules(LISP <!1><A HREF="EST_SCFG.html#DOC.105.2.3">rules</A>)</B></TT>
<DD>Set (or reset) rules from external source after construction
<DL><DT><DD></DL><P>
<A NAME="get_rules"></A>
<A NAME="DOC.105.2.2"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>LISP get_rules()</B></TT>
<DD>Return rules as LISP list
<DL><DT><DD></DL><P>
<A NAME="rules"></A>
<A NAME="DOC.105.2.3"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>SCFGRuleList rules</B></TT>
<DD>The rules themselves
<DL><DT><DD></DL><P>
<A NAME="find_terms_nonterms"></A>
<A NAME="DOC.105.2.4"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void find_terms_nonterms(EST_StrList &amp;nt, EST_StrList &amp;<!1><A HREF="EST_Wave.html#DOC.81.4.5">t</A>, LISP <!1><A HREF="EST_SCFG.html#DOC.105.2.3">rules</A>)</B></TT>
<DD>Find the terminals and nonterminals in the given grammar, adding
them to the appropriate given string lists
<DL><DT><DD></DL><P>
<A NAME="nonterminal"></A>
<A NAME="DOC.105.2.5"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="EST_String.html">EST_String</A> nonterminal(int <!1><A HREF="XML_Parser.html#DOC.190.3.9">p</A>) const </B></TT>
<DD>Convert nonterminal index to string form
<DL><DT><DD></DL><P>
<A NAME="terminal"></A>
<A NAME="DOC.105.2.6"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="EST_String.html">EST_String</A> terminal(int m) const </B></TT>
<DD>Convert terminal index to string form
<DL><DT><DD></DL><P>
<A NAME="nonterminal"></A>
<A NAME="DOC.105.2.7"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int nonterminal(const <!1><A HREF="EST_String.html">EST_String</A> &amp;<!1><A HREF="XML_Parser.html#DOC.190.3.9">p</A>) const </B></TT>
<DD>Convert nonterminal string to index
<DL><DT><DD></DL><P>
<A NAME="terminal"></A>
<A NAME="DOC.105.2.8"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int terminal(const <!1><A HREF="EST_String.html">EST_String</A> &amp;m) const </B></TT>
<DD>Convert terminal string to index
<DL><DT><DD></DL><P>
<A NAME="num_nonterminals"></A>
<A NAME="DOC.105.2.9"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int num_nonterminals() const </B></TT>
<DD>Number of nonterminals
<DL><DT><DD></DL><P>
<A NAME="num_terminals"></A>
<A NAME="DOC.105.2.10"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>int num_terminals() const </B></TT>
<DD>Number of terminals
<DL><DT><DD></DL><P>
<A NAME="prob_B"></A>
<A NAME="DOC.105.2.11"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>double prob_B(int <!1><A HREF="XML_Parser.html#DOC.190.3.9">p</A>, int q, int r) const </B></TT>
<DD>The rule probability of given binary rule
<DL><DT><DD></DL><P>
<A NAME="prob_U"></A>
<A NAME="DOC.105.2.12"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>double prob_U(int <!1><A HREF="XML_Parser.html#DOC.190.3.9">p</A>, int m) const </B></TT>
<DD>The rule probability of given unary rule
<DL><DT><DD></DL><P>
<A NAME="set_rule_prob_cache"></A>
<A NAME="DOC.105.2.13"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void set_rule_prob_cache()</B></TT>
<DD>(re-)set rule probability caches
<DL><DT><DD></DL><P></DL>

<A NAME="file i/o functions "></A>
<A NAME="DOC.105.3"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> file i/o functions </B></TT>
<DL><DT><DD></DL><P><DL>

<A NAME="load"></A>
<A NAME="DOC.105.3.1"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="EST_read_status.html">EST_read_status</A> load(const <!1><A HREF="EST_String.html">EST_String</A> &amp;<!1><A HREF="EST_TokenStream.html#DOC.10.7.9">filename</A>)</B></TT>
<DD>Load grammar from named file
<DL><DT><DD></DL><P>
<A NAME="save"></A>
<A NAME="DOC.105.3.2"></A>
<DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="EST_write_status.html">EST_write_status</A> save(const <!1><A HREF="EST_String.html">EST_String</A> &amp;<!1><A HREF="EST_TokenStream.html#DOC.10.7.9">filename</A>)</B></TT>
<DD>Save current grammar to named file
<DL><DT><DD></DL><P></DL>
</DL>
<HR>
<DL><DT><B>Direct child classes:
</B><DD><A HREF="EST_SCFG_traintest.html">EST_SCFG_traintest</A><BR>
</DL>

<DL><DT><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>