spaCy/spacy/tokens.pxd

64 lines
1.3 KiB
Cython
Raw Normal View History

2014-12-16 14:44:43 +03:00
from libc.stdint cimport uint32_t
2014-12-02 15:48:05 +03:00
import numpy as np
cimport numpy as np
from cymem.cymem cimport Pool
2014-12-21 23:25:43 +03:00
from thinc.typedefs cimport atom_t
2014-12-21 23:25:43 +03:00
from .typedefs cimport flags_t
from .structs cimport Morphology, TokenC, Lexeme
from .vocab cimport Vocab
2014-12-19 23:03:26 +03: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-21 23:25:43 +03:00
cdef Vocab vocab
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-23 07:18:48 +03:00
cpdef np.ndarray[long, ndim=2] to_array(self, object features)
2014-12-02 15:48:05 +03:00
cdef class Token:
2014-12-21 23:25:43 +03:00
cdef readonly StringStore string_store
cdef public int i
cdef public int idx
cdef readonly int pos_id
cdef readonly int dep_id
2014-12-08 13:12:15 +03:00
cdef int lemma
2014-12-17 13:10:12 +03:00
cdef public int head
cdef public int dep_tag
2014-12-21 23:25:43 +03:00
cdef public atom_t id
cdef public atom_t cluster
cdef public atom_t length
cdef public atom_t postype
cdef public atom_t sensetype
cdef public atom_t sic
cdef public atom_t norm
cdef public atom_t shape
cdef public atom_t asciied
cdef public atom_t prefix
cdef public atom_t suffix
cdef public float prob
cdef public flags_t flags