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

This commit is contained in:
kr.angelov
2012-12-14 15:32:49 +00:00
parent 79711380a2
commit 8aefd1e072
7 changed files with 255 additions and 38 deletions

View File

@@ -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