2016-10-14 01:24:13 +00:00
|
|
|
cimport numpy as np
|
|
|
|
|
2015-07-13 18:20:58 +00:00
|
|
|
from .doc cimport Doc
|
2017-05-28 16:09:27 +00:00
|
|
|
from ..typedefs cimport attr_t
|
2021-01-14 06:30:41 +00:00
|
|
|
from ..structs cimport SpanC
|
2015-07-13 18:20:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
cdef class Span:
|
2015-09-29 13:03:55 +00:00
|
|
|
cdef readonly Doc doc
|
2021-01-14 06:30:41 +00:00
|
|
|
cdef SpanC c
|
2015-09-17 01:50:11 +00:00
|
|
|
cdef public _vector
|
|
|
|
cdef public _vector_norm
|
2015-11-06 21:56:49 +00:00
|
|
|
|
2021-01-14 06:30:41 +00:00
|
|
|
@staticmethod
|
|
|
|
cdef inline Span cinit(Doc doc, SpanC span):
|
|
|
|
cdef Span self = Span.__new__(
|
|
|
|
Span,
|
|
|
|
doc,
|
|
|
|
start=span.start,
|
|
|
|
end=span.end
|
|
|
|
)
|
|
|
|
self.c = span
|
|
|
|
return self
|
|
|
|
|
2017-08-19 10:20:45 +00:00
|
|
|
cpdef np.ndarray to_array(self, object features)
|