53static int scfg_test_main(
int argc,
char **argv);
89int main(
int argc,
char **argv)
92 scfg_test_main(argc,argv);
98static int scfg_test_main(
int argc,
char **argv)
107 "Summary: Test a stochastic context free grammar against a corpus\n"+
108 "-grammar <ifile> Grammar file, one rule per line.\n"+
109 "-corpus <ifile> Single Corpus file, one bracketed sentence per line.\n"+
110 "-crossbrackets Measure cross bracket performance.\n"+
111 "-heap <int> {210000}\n"+
112 " Set size of Lisp heap, needed for large corpora\n"+
113 "-o <ofile> Output file for parsed sentences.\n",
117 outfile = al.
val(
"-o");
121 siod_init(al.
ival(
"-heap"));
127 grammar.
load(al.
val(
"-grammar"));
131 cerr <<
"scfg_test: no grammar specified" << endl;
141 cerr <<
"scfg_test: no corpus specified" << endl;
146 if (al.
present(
"-crossbrackets"))
int ival(const EST_String &rkey, int m=1) const
void load_corpus(const EST_String &filename)
void test_crossbrackets()
EST_read_status load(const EST_String &filename)
Load grammar from named file.
const V & val(const K &rkey, bool m=0) const
return value according to key (const)
const int present(const K &rkey) const
Returns true if key is present.