mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 09:56:28 +03:00
19 lines
469 B
Cython
19 lines
469 B
Cython
from libcpp.vector cimport vector
|
|
from spacy.lexeme cimport LexID
|
|
from spacy.lexeme cimport Lexeme
|
|
|
|
from cython.operator cimport dereference as deref
|
|
from spacy.spacy cimport Language
|
|
|
|
|
|
cdef class Tokens:
|
|
cdef Language lang
|
|
cdef vector[LexID]* vctr
|
|
cdef size_t length
|
|
|
|
cpdef int append(self, LexID token)
|
|
cpdef int extend(self, Tokens other) except -1
|
|
|
|
cpdef object group_by(self, size_t attr)
|
|
cpdef dict count_by(self, size_t attr)
|