Edinburgh Speech Tools 2.4-release
EST_SCFG_Rule Class Reference

#include <include/EST_SCFG.h>

Public Member Functions

 EST_SCFG_Rule (const EST_SCFG_Rule &r)
 
 EST_SCFG_Rule (double prob, int p, int m)
 Create a unary rule. More...
 
 EST_SCFG_Rule (double prob, int p, int q, int r)
 Create a binary rule. More...
 
double prob () const
 The rule's probability. More...
 
void set_prob (double p)
 set the probability More...
 
est_scfg_rtype type () const
 rule type More...
 
int mother () const
 
int daughter1 () const
 
int daughter2 () const
 
void set_rule (double prob, int p, int m)
 
void set_rule (double prob, int p, int q, int r)
 

Detailed Description

A stochastic context free grammar rule.

At present only two types of rule are supported: {\tt est_scfg_binary_rule} and {\tt est_scfg_unary_rule}. This is sufficient for the representation of grammars in Chomsky Normal Form. Each rule also has a probability associated with it. Terminals and noterminals are represented as ints using the \Ref{EST_Discrete}s in \Ref{EST_SCFG} to reference the actual alphabets.

Although this class includes a `‘probability’' nothing in the rule itself enforces it to be a true probability. It is responsibility of the classes that use this rule to enforce that condition if desired.

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

Definition at line 121 of file EST_SCFG.h.

Constructor & Destructor Documentation

◆ EST_SCFG_Rule() [1/4]

EST_SCFG_Rule::EST_SCFG_Rule ( )
inline

Definition at line 130 of file EST_SCFG.h.

◆ EST_SCFG_Rule() [2/4]

EST_SCFG_Rule::EST_SCFG_Rule ( const EST_SCFG_Rule r)
inline

Definition at line 132 of file EST_SCFG.h.

◆ EST_SCFG_Rule() [3/4]

EST_SCFG_Rule::EST_SCFG_Rule ( double  prob,
int  p,
int  m 
)

Create a unary rule.

Definition at line 44 of file EST_SCFG.cc.

◆ EST_SCFG_Rule() [4/4]

EST_SCFG_Rule::EST_SCFG_Rule ( double  prob,
int  p,
int  q,
int  r 
)

Create a binary rule.

Definition at line 49 of file EST_SCFG.cc.

Member Function Documentation

◆ prob()

double EST_SCFG_Rule::prob ( ) const
inline

The rule's probability.

Definition at line 140 of file EST_SCFG.h.

◆ set_prob()

void EST_SCFG_Rule::set_prob ( double  p)
inline

set the probability

Definition at line 142 of file EST_SCFG.h.

◆ type()

est_scfg_rtype EST_SCFG_Rule::type ( ) const
inline

rule type

Definition at line 144 of file EST_SCFG.h.

◆ mother()

int EST_SCFG_Rule::mother ( ) const
inline

Definition at line 146 of file EST_SCFG.h.

◆ daughter1()

int EST_SCFG_Rule::daughter1 ( ) const
inline

In a unary rule this is a terminal, in a binary rule it is a nonterminal

Definition at line 150 of file EST_SCFG.h.

◆ daughter2()

int EST_SCFG_Rule::daughter2 ( ) const
inline

Definition at line 152 of file EST_SCFG.h.

◆ set_rule() [1/2]

void EST_SCFG_Rule::set_rule ( double  prob,
int  p,
int  m 
)

Definition at line 54 of file EST_SCFG.cc.

◆ set_rule() [2/2]

void EST_SCFG_Rule::set_rule ( double  prob,
int  p,
int  q,
int  r 
)

Definition at line 62 of file EST_SCFG.cc.


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