From 20aaa4a9899ce454d3c20594a2b7d2d3d38dbc88 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Fri, 14 Dec 2012 15:32:49 +0000 Subject: The first prototype for exhaustive generation in the C runtime. The trees are always listed in decreasing probability order. There is also an API for generation from Python --- src/runtime/python/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/runtime/python/test.py') diff --git a/src/runtime/python/test.py b/src/runtime/python/test.py index cb0ba5452..ae0427d60 100644 --- a/src/runtime/python/test.py +++ b/src/runtime/python/test.py @@ -19,8 +19,8 @@ while True: break; try: - for e in gr.languages["ParseEng"].parse(gr.startCat,line): - print e + for (p,e) in gr.languages["ParseEng"].parse(gr.startCat,line): + sys.stdout.write("["+str(p)+"] "+str(e)+"\n") print gr.languages["ParseEngBul"].linearize(e) except pgf.ParseError as e: print e.message -- cgit v1.2.3