40 #ifndef __EST_SCFG_CHART_H__
41 #define __EST_SCFG_CHART_H__
43 #include "EST_String.h"
44 #include "EST_simplestats.h"
45 #include "EST_string_aux.h"
47 #include "ling_class/EST_Relation.h"
73 int pos(
void) {
return p_pos; }
75 double prob(
void) {
return p_prob; }
77 int d1() {
return p_d1; }
79 int d2() {
return p_d2; }
117 double find_best_tree(
int start,
int end,
int p)
119 if ((r=edges[start][end][p]) != 0)
return r->
prob();
120 else return find_best_tree_cal(start,end,p); }
122 double find_best_tree_cal(
int start,
int end,
int p);
123 void setup_edge_table();
124 void delete_edge_table();
127 void extract_edge(
int start,
int end,
int p,
170 void EST_SCFG_chart_load_relation(
EST_Relation *s,LISP sent);
174 LISP scfg_parse(LISP
string,LISP grammar);
177 LISP scfg_parse(LISP
string,
EST_SCFG &grammar);
int pos(void)
Postion, 0 1 or 2, where 0 is empty, 1 is incomplete 2 is complete.
double prob(void)
Edge probability.
int d1()
(Non)terminal of daughter 1
int d2()
(Non)terminal of daughter 2
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")
void parse()
Parses the loaded WFST with the loaded grammar.
LISP find_parse()
Return the parse in full LISP form.
void set_grammar_rules(LISP r)
Initialize from LISP rules set.