2019-08-22 15:17:07 +00:00
|
|
|
from libcpp.vector cimport vector
|
2019-09-27 14:22:34 +00:00
|
|
|
from cymem.cymem cimport Pool
|
|
|
|
from preshed.maps cimport key_t, MapStruct
|
2019-08-22 15:17:07 +00:00
|
|
|
|
2019-09-27 14:22:34 +00:00
|
|
|
from ..attrs cimport attr_id_t
|
2019-10-18 09:01:47 +00:00
|
|
|
from ..structs cimport SpanC
|
2019-09-27 14:22:34 +00:00
|
|
|
from ..tokens.doc cimport Doc
|
|
|
|
from ..vocab cimport Vocab
|
|
|
|
|
|
|
|
|
|
|
|
cdef class PhraseMatcher:
|
2019-10-04 10:18:41 +00:00
|
|
|
cdef readonly Vocab vocab
|
2019-09-27 14:22:34 +00:00
|
|
|
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
|
|
|
|
|
2021-02-10 12:43:32 +00:00
|
|
|
cdef void find_matches(self, Doc doc, int start_idx, int end_idx, vector[SpanC] *matches) nogil
|