2014-07-05 18:51:42 +00:00
|
|
|
from libcpp.vector cimport vector
|
2014-08-02 20:51:52 +00:00
|
|
|
from libc.stdint cimport uint32_t
|
2014-07-07 02:21:06 +00:00
|
|
|
from libc.stdint cimport uint64_t
|
|
|
|
|
|
|
|
# Circular import problems here
|
|
|
|
ctypedef size_t Lexeme_addr
|
2014-08-02 20:51:52 +00:00
|
|
|
ctypedef uint32_t StringHash
|
2014-07-07 14:58:48 +00:00
|
|
|
from spacy.lexeme cimport Lexeme
|
|
|
|
|
|
|
|
from spacy.tokens cimport Tokens
|
|
|
|
|
|
|
|
# Put these above import to avoid circular import problem
|
|
|
|
ctypedef char Bits8
|
|
|
|
ctypedef uint64_t Bits64
|
|
|
|
ctypedef int ClusterID
|
2014-07-05 18:51:42 +00:00
|
|
|
|
|
|
|
|
2014-07-07 02:21:06 +00:00
|
|
|
from spacy.lexeme cimport Lexeme
|
2014-07-07 14:58:48 +00:00
|
|
|
|
2014-07-07 10:47:21 +00:00
|
|
|
|
|
|
|
cdef class Language:
|
|
|
|
cdef object name
|
2014-08-22 15:13:09 +00:00
|
|
|
cdef dict chunks
|
|
|
|
cdef dict vocab
|
2014-07-07 10:47:21 +00:00
|
|
|
cdef dict bacov
|
2014-07-07 02:21:06 +00:00
|
|
|
|
2014-08-20 11:39:39 +00:00
|
|
|
cpdef Tokens tokenize(self, unicode text)
|
2014-08-16 01:22:03 +00:00
|
|
|
|
2014-08-18 17:14:00 +00:00
|
|
|
cdef Lexeme* lookup(self, unicode string) except NULL
|
2014-08-18 18:48:48 +00:00
|
|
|
cdef Lexeme** lookup_chunk(self, unicode chunk) except NULL
|
2014-08-16 01:22:03 +00:00
|
|
|
|
2014-08-18 17:14:00 +00:00
|
|
|
cdef Lexeme** new_chunk(self, unicode string, list substrings) except NULL
|
|
|
|
cdef Lexeme* new_lexeme(self, unicode lex) except NULL
|
2014-08-16 01:22:03 +00:00
|
|
|
|
2014-08-20 11:39:39 +00:00
|
|
|
cpdef unicode unhash(self, StringHash hashed)
|
2014-07-07 10:47:21 +00:00
|
|
|
|
2014-08-20 11:39:39 +00:00
|
|
|
cpdef list find_substrings(self, unicode chunk)
|
2014-08-18 17:14:00 +00:00
|
|
|
cdef int find_split(self, unicode word)
|
2014-08-20 11:39:39 +00:00
|
|
|
cdef int set_orth(self, unicode string, Lexeme* word)
|