53static int scfg_test_main(
int argc,
char **
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",
116 if (
al.present(
"-o"))
117 outfile =
al.val(
"-o");
121 siod_init(
al.ival(
"-heap"));
125 if (
al.present(
"-grammar"))
127 grammar.
load(
al.val(
"-grammar"));
131 cerr <<
"scfg_test: no grammar specified" <<
endl;
135 if (
al.present(
"-corpus"))
141 cerr <<
"scfg_test: no corpus specified" <<
endl;
146 if (
al.present(
"-crossbrackets"))
void load_corpus(const EST_String &filename)
void test_crossbrackets()
EST_read_status load(const EST_String &filename)
Load grammar from named file.