Update NewExample

This commit is contained in:
Matthew Honnibal 2020-06-09 23:06:48 +02:00
parent ccd332a9fc
commit b3868cd1f8

View File

@ -31,14 +31,20 @@ cdef class NewExample:
self.y = reference
self._alignment = alignment
@property
def predicted(self):
property predicted:
def __get__(self):
return self.x
@property
def reference(self):
def __set__(self, doc):
self.x = doc
property reference:
def __get__(self):
return self.y
def __set__(self, doc):
self.y = doc
@classmethod
def from_dict(cls, Doc predicted, dict example_dict):
if example_dict is None: