40 #ifndef __EST_SCFG_CHART_H__
41 #define __EST_SCFG_CHART_H__
43 #include "EST_String.h"
44 #include "EST_simplestats.h"
47 #include "ling_class/EST_Relation.h"
74 int pos(
void) {
return p_pos; }
76 double prob(
void) {
return p_prob; }
78 int d1() {
return p_d1; }
80 int d2() {
return p_d2; }
119 double find_best_tree(
int start,
int end,
int p)
121 if ((r=edges[start][end][p]) != 0)
return r->
prob();
122 else return find_best_tree_cal(start,end,p); }
124 double find_best_tree_cal(
int start,
int end,
int p);
125 void setup_edge_table();
126 void delete_edge_table();
129 void extract_edge(
int start,
int end,
int p,
172 void EST_SCFG_chart_load_relation(
EST_Relation *s,LISP sent);
176 LISP scfg_parse(LISP
string,LISP grammar);
179 LISP scfg_parse(LISP
string,
EST_SCFG &grammar);
int d2()
(Non)terminal of daughter 2
int pos(void)
Postion, 0 1 or 2, where 0 is empty, 1 is incomplete 2 is complete.
int d1()
(Non)terminal of daughter 1
void parse()
Parses the loaded WFST with the loaded grammar.
A class representing a stochastic context free grammar (SCFG).
LISP find_parse()
Return the parse in full LISP form.
void extract_parse(EST_Relation *syn, EST_Relation *word, int force=0)
Extract parse tree and add it to syn linking leafs to word.
void setup_wfst(EST_Relation *s, const EST_String &name="name")
double prob(void)
Edge probability.
void set_grammar_rules(LISP r)
Initialize from LISP rules set.
A class for parsing with a probabilistic grammars.
An internal class for EST_SCFG_Chart for representing edges in the chart during parsing with SCFGs...
Utility EST_String Functions header file.