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