A class for parsing with a probabilistic grammars. More...
#include <include/EST_SCFG_Chart.h>
Public Member Functions | |
Constructor and initialisation functions | |
EST_SCFG_Chart () | |
~EST_SCFG_Chart () | |
Grammar and parse string initialisation functions | |
void | set_grammar_rules (LISP r) |
Initialize from LISP rules set. More... | |
void | set_grammar_rules (EST_SCFG &grammar) |
Initialize from existing EST_SCFG grammar. More... | |
void | setup_wfst (EST_Relation *s, const EST_String &name="name") |
void | setup_wfst (EST_Item *s, EST_Item *e, const EST_String &name="name") |
parsing functions | |
void | parse () |
Parses the loaded WFST with the loaded grammar. More... | |
LISP | find_parse () |
Return the parse in full LISP form. More... | |
void | extract_parse (EST_Relation *syn, EST_Relation *word, int force=0) |
Extract parse tree and add it to syn linking leafs to word. More... | |
void | extract_parse (EST_Relation *syn, EST_Item *s, EST_Item *e, int force=0) |
Extract parse tree and add it to syn linking leafs to items s to e. More... | |
A class for parsing with a probabilistic grammars.
The chart (sort of closer to CKY table) consists of indexes of edges indexed by vertex number of mother non-terminal.
The initial values (well-formed substring table) are taken from an EST_String with a given feature. The grammar may be specified as LISP rules or as an already constructed EST_SCFG.
This produces a single best parse. It treats the grammar as strictly context free in that the probability of a nonterminal over vertex n
to m
, is the sum of all the possible analyses of that sub-tree. Only the best analysis is kept for the resulting parse tree.
Definition at line 102 of file EST_SCFG_Chart.h.
EST_SCFG_Chart::EST_SCFG_Chart | ( | ) |
Definition at line 111 of file EST_SCFG_Chart.cc.
EST_SCFG_Chart::~EST_SCFG_Chart | ( | ) |
Definition at line 121 of file EST_SCFG_Chart.cc.
void EST_SCFG_Chart::set_grammar_rules | ( | LISP | r | ) |
Initialize from LISP rules set.
Definition at line 138 of file EST_SCFG_Chart.cc.
void EST_SCFG_Chart::set_grammar_rules | ( | EST_SCFG & | grammar | ) |
Initialize from existing EST_SCFG grammar.
Definition at line 130 of file EST_SCFG_Chart.cc.
void EST_SCFG_Chart::setup_wfst | ( | EST_Relation * | s, |
const EST_String & | name = "name" |
||
) |
Initialize for parsing from relation using name
feature setting up the "Well Formed Substring Table"
Definition at line 143 of file EST_SCFG_Chart.cc.
void EST_SCFG_Chart::setup_wfst | ( | EST_Item * | s, |
EST_Item * | e, | ||
const EST_String & | name = "name" |
||
) |
Initialize for parsing from s to e using name
feature setting up the "Well Formed Substring Table"
Definition at line 150 of file EST_SCFG_Chart.cc.
void EST_SCFG_Chart::parse | ( | void | ) |
Parses the loaded WFST with the loaded grammar.
Definition at line 284 of file EST_SCFG_Chart.cc.
LISP EST_SCFG_Chart::find_parse | ( | ) |
Return the parse in full LISP form.
Definition at line 292 of file EST_SCFG_Chart.cc.
void EST_SCFG_Chart::extract_parse | ( | EST_Relation * | syn, |
EST_Relation * | word, | ||
int | force = 0 |
||
) |
Extract parse tree and add it to syn linking leafs to word.
Definition at line 305 of file EST_SCFG_Chart.cc.
void EST_SCFG_Chart::extract_parse | ( | EST_Relation * | syn, |
EST_Item * | s, | ||
EST_Item * | e, | ||
int | force = 0 |
||
) |
Extract parse tree and add it to syn linking leafs to items s to e.
Definition at line 316 of file EST_SCFG_Chart.cc.