2014-07-07 14:47:21 +04:00
|
|
|
from libcpp.vector cimport vector
|
2014-08-22 02:02:37 +04:00
|
|
|
from spacy.lexeme cimport LexID
|
2014-08-18 21:14:00 +04:00
|
|
|
from spacy.lexeme cimport Lexeme
|
2014-07-07 14:47:21 +04:00
|
|
|
|
|
|
|
from cython.operator cimport dereference as deref
|
|
|
|
from spacy.spacy cimport Language
|
|
|
|
|
|
|
|
|
|
|
|
cdef class Tokens:
|
|
|
|
cdef Language lang
|
2014-08-22 02:02:37 +04:00
|
|
|
cdef vector[LexID]* vctr
|
2014-07-07 14:47:21 +04:00
|
|
|
cdef size_t length
|
|
|
|
|
2014-08-22 02:02:37 +04:00
|
|
|
cpdef int append(self, LexID token)
|
2014-07-07 14:47:21 +04:00
|
|
|
cpdef int extend(self, Tokens other) except -1
|
|
|
|
|
2014-08-20 15:39:39 +04:00
|
|
|
cpdef object group_by(self, size_t attr)
|
|
|
|
cpdef dict count_by(self, size_t attr)
|