summaryrefslogtreecommitdiff
path: root/gi/evaluation/extract_ccg_labels.py
diff options
context:
space:
mode:
authortrevor.cohn <trevor.cohn@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-16 21:45:45 +0000
committertrevor.cohn <trevor.cohn@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-16 21:45:45 +0000
commit55933074dcf0e3d5e38fe6ad87b925d7f694ceb1 (patch)
tree1d8dfd42b3f272b044bda5a59a1c76be663b0ee7 /gi/evaluation/extract_ccg_labels.py
parent1207aaee1f55dbaac8a46f37635a4d1baf392760 (diff)
Added pictures
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@299 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi/evaluation/extract_ccg_labels.py')
-rw-r--r--gi/evaluation/extract_ccg_labels.py11
1 files changed, 8 insertions, 3 deletions
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