mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
d359da9687
* Replace MatchStruct with Entity Replace MatchStruct with Entity since the existing Entity struct is nearly identical. * Replace Entity with more general SpanC
23 lines
528 B
Cython
23 lines
528 B
Cython
from libcpp.vector cimport vector
|
|
|
|
from cymem.cymem cimport Pool
|
|
from preshed.maps cimport key_t, MapStruct
|
|
|
|
from ..attrs cimport attr_id_t
|
|
from ..structs cimport SpanC
|
|
from ..tokens.doc cimport Doc
|
|
from ..vocab cimport Vocab
|
|
|
|
|
|
cdef class PhraseMatcher:
|
|
cdef readonly Vocab vocab
|
|
cdef attr_id_t attr
|
|
cdef object _callbacks
|
|
cdef object _docs
|
|
cdef bint _validate
|
|
cdef MapStruct* c_map
|
|
cdef Pool mem
|
|
cdef key_t _terminal_hash
|
|
|
|
cdef void find_matches(self, Doc doc, vector[SpanC] *matches) nogil
|