mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
ba18d2913d
* `Morphology`: Refactor to use C types, reduce allocations, remove unused code * `Morphologzier`: Avoid unnecessary sorting of morpho features * `Morphologizer`: Remove execessive reallocations of labels, improve hash lookups of labels, coerce `numpy` numeric types to native ints Update docs * Remove unused method * Replace `unique_ptr` usage with `shared_ptr` * Add type annotations to internal Python methods, rename `hash` variable, fix typos * Add comment to clarify implementation detail * Fix return type * `Morphology`: Stop early when splitting fields and values
13 lines
303 B
Cython
13 lines
303 B
Cython
from ..vocab cimport Vocab
|
|
from ..typedefs cimport hash_t
|
|
from ..morphology cimport MorphAnalysisC
|
|
from libcpp.memory cimport shared_ptr
|
|
|
|
|
|
cdef class MorphAnalysis:
|
|
cdef readonly Vocab vocab
|
|
cdef readonly hash_t key
|
|
cdef shared_ptr[MorphAnalysisC] c
|
|
|
|
cdef void _init_c(self, hash_t key)
|