A stochastic context free grammar rule. More...
#include <include/EST_SCFG.h>
Public Member Functions | |
EST_SCFG_Rule () | |
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) |
A stochastic context free grammar rule.
At present only two types of rule are supported: est\_scfg\_binary\_rule
and 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 EST_Discrete s in 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.
Definition at line 123 of file EST_SCFG.h.
|
inline |
Definition at line 132 of file EST_SCFG.h.
|
inline |
Definition at line 135 of file EST_SCFG.h.
Create a unary rule.
Definition at line 46 of file EST_SCFG.cc.
Create a binary rule.
Definition at line 52 of file EST_SCFG.cc.
|
inline |
The rule's probability.
Definition at line 143 of file EST_SCFG.h.
|
inline |
set the probability
Definition at line 145 of file EST_SCFG.h.
|
inline |
rule type
Definition at line 147 of file EST_SCFG.h.
|
inline |
Definition at line 149 of file EST_SCFG.h.
|
inline |
In a unary rule this is a terminal, in a binary rule it is a nonterminal
Definition at line 153 of file EST_SCFG.h.
|
inline |
Definition at line 155 of file EST_SCFG.h.
Definition at line 57 of file EST_SCFG.cc.
Definition at line 65 of file EST_SCFG.cc.