diff options
author | trevor.cohn <trevor.cohn@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-20 21:54:01 +0000 |
---|---|---|
committer | trevor.cohn <trevor.cohn@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-20 21:54:01 +0000 |
commit | dedfa33b198c8bbb4af879efe73607f2dc4de584 (patch) | |
tree | 97d5cd2b6cf0ff78e58d627b28d53eaf70e5ed0a /gi/evaluation/extract_ccg_labels.py | |
parent | cd5d8e0ab902a0c87e108b863aca2888248a4516 (diff) |
fixed typo
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@343 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi/evaluation/extract_ccg_labels.py')
-rw-r--r-- | gi/evaluation/extract_ccg_labels.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gi/evaluation/extract_ccg_labels.py b/gi/evaluation/extract_ccg_labels.py index 77f21004..e0034648 100644 --- a/gi/evaluation/extract_ccg_labels.py +++ b/gi/evaluation/extract_ccg_labels.py @@ -90,10 +90,13 @@ for tline, eline in itertools.izip(tinfile, einfile): else: tr = None - zh, en, spans = eline.strip().split(" ||| ") + parts = eline.strip().split(" ||| ") + zh, en = parts[:2] + spans = parts[-1] print '|||', for span in spans.split(): - i, j, x, y = map(int, span.split("-")) + sps = span.split(":") + i, j, x, y = map(int, sps[0].split("-")) if tr: a = ancestor(tr, range(x,y)) @@ -113,7 +116,8 @@ for tline, eline in itertools.izip(tinfile, einfile): cat += '\\' + f.data.tag else: break - for f in reversed(fs): + fs.reverse() + for f in fs: if f.left >= y: cat += '/' + f.data.tag else: |