* Support 'punct' dep label in conll.pyx

This commit is contained in:
Matthew Honnibal 2015-04-05 22:30:19 +02:00
parent 021c972137
commit a60a366b2c

View File

@ -107,12 +107,12 @@ cdef class GoldParse:
@property
def n_non_punct(self):
return len([l for l in self.labels if l != 'P'])
return len([l for l in self.labels if l not in ('P', 'punct')])
cdef int heads_correct(self, TokenC* tokens, bint score_punct=False) except -1:
n = 0
for i in range(self.length):
if not score_punct and self.labels_[i] == 'P':
if not score_punct and self.labels_[i] not in ('P', 'punct'):
continue
if self.heads[i] == -1:
continue