From 55933074dcf0e3d5e38fe6ad87b925d7f694ceb1 Mon Sep 17 00:00:00 2001 From: "trevor.cohn" Date: Fri, 16 Jul 2010 21:45:45 +0000 Subject: Added pictures git-svn-id: https://ws10smt.googlecode.com/svn/trunk@299 ec762483-ff6d-05da-a07a-a48fb63a330f --- gi/evaluation/extract_ccg_labels.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gi/evaluation/extract_ccg_labels.py') diff --git a/gi/evaluation/extract_ccg_labels.py b/gi/evaluation/extract_ccg_labels.py index 5dd6eb65..77f21004 100644 --- a/gi/evaluation/extract_ccg_labels.py +++ b/gi/evaluation/extract_ccg_labels.py @@ -84,8 +84,9 @@ for tline, eline in itertools.izip(tinfile, einfile): if tline.startswith('( '): tline = tline[2:-1].strip() tr = tree.parse_PST(tline) - number_leaves(tr) - #project_heads(tr) # assumes Bikel-style head annotation for the input trees + if tr != None: + number_leaves(tr) + #project_heads(tr) # assumes Bikel-style head annotation for the input trees else: tr = None @@ -96,7 +97,11 @@ for tline, eline in itertools.izip(tinfile, einfile): if tr: a = ancestor(tr, range(x,y)) - fs = frontier(a, range(x,y)) + try: + fs = frontier(a, range(x,y)) + except: + print >>sys.stderr, "problem with line", tline.strip(), "--", eline.strip() + raise #print x, y #print 'ancestor', a -- cgit v1.2.3