spaCy/spacy/tokens.pxd

63 lines
1.2 KiB
Cython
Raw Normal View History

2014-12-16 11:44:43 +00:00
from libc.stdint cimport uint32_t
2014-12-02 12:48:05 +00:00
import numpy as np
cimport numpy as np
from cymem.cymem cimport Pool
2014-12-19 20:03:26 +00:00
from .structs cimport Lexeme, TokenC, Morphology
2014-12-08 10:12:15 +00:00
2014-12-19 20:03:26 +00:00
from .typedefs cimport flags_t, attr_t, flags_t
2014-12-08 10:12:15 +00:00
2014-12-19 20:03:26 +00:00
from .strings cimport StringStore
ctypedef const Lexeme* const_Lexeme_ptr
ctypedef TokenC* TokenC_ptr
ctypedef fused LexemeOrToken:
const_Lexeme_ptr
TokenC_ptr
cdef class Tokens:
cdef Pool mem
2014-12-19 20:03:26 +00:00
cdef StringStore strings
cdef list tag_names
cdef TokenC* data
cdef int length
cdef int max_length
cdef int push_back(self, int i, LexemeOrToken lex_or_tok) except -1
2014-12-04 09:46:55 +00:00
cpdef np.ndarray[long, ndim=2] get_array(self, list features)
2014-12-02 12:48:05 +00:00
cdef class Token:
2014-12-19 20:03:26 +00:00
cdef public StringStore strings
cdef public int i
cdef public int idx
cdef int pos
2014-12-08 10:12:15 +00:00
cdef int lemma
2014-12-17 10:10:12 +00:00
cdef public int head
cdef public int dep_tag
2014-12-19 20:03:26 +00:00
cdef public attr_t id
cdef public attr_t cluster
cdef public attr_t length
cdef public attr_t postype
cdef public attr_t sensetype
cdef public attr_t sic
cdef public attr_t norm
cdef public attr_t shape
cdef public attr_t asciied
cdef public attr_t prefix
cdef public attr_t suffix
cdef public float prob
cdef public flags_t flags