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