Add __len__ method for Example

This commit is contained in:
Matthw Honnibal 2020-07-09 14:38:26 +02:00
parent 9b49787f35
commit eb0798c421
1 changed files with 3 additions and 0 deletions

View File

@ -36,6 +36,9 @@ cdef class Example:
self.y = reference self.y = reference
self._alignment = alignment self._alignment = alignment
def __len__(self):
return len(self.predicted)
property predicted: property predicted:
def __get__(self): def __get__(self):
return self.x return self.x