mirror of https://github.com/explosion/spaCy.git
Add __len__ method for Example
This commit is contained in:
parent
9b49787f35
commit
eb0798c421
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue