mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
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._alignment = alignment
|
||||
|
||||
def __len__(self):
|
||||
return len(self.predicted)
|
||||
|
||||
property predicted:
|
||||
def __get__(self):
|
||||
return self.x
|
||||
|
|
Loading…
Reference in New Issue
Block a user