* Fix heads problem in read_conll

This commit is contained in:
Matthew Honnibal 2015-05-27 01:14:54 +02:00
parent 0eec1d12af
commit f69fe6a635

View File

@ -13,7 +13,6 @@ def parse(sent_text, strip_bad_periods=False):
id_map = {}
for i, line in enumerate(sent_text.split('\n')):
word, tag, head, dep = _parse_line(line)
id_map[i] = len(words)
if strip_bad_periods and words and _is_bad_period(words[-1], word):
continue
@ -24,8 +23,6 @@ def parse(sent_text, strip_bad_periods=False):
'head': int(head) - 1,
'dep': dep})
words.append(word)
for entry in annot:
entry['head'] = id_map.get(entry['head'], entry['head'])
return words, annot