mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 02:36:32 +03:00
* Rename Token.lex_pos to Token.postype, and Token.lex_supersense to Token.sensetype
This commit is contained in:
parent
a8ca078b24
commit
b186a66bae
|
@ -31,10 +31,11 @@ cdef class Token:
|
||||||
cdef public int idx
|
cdef public int idx
|
||||||
cdef public int pos
|
cdef public int pos
|
||||||
|
|
||||||
|
cdef public atom_t id
|
||||||
cdef public atom_t cluster
|
cdef public atom_t cluster
|
||||||
cdef public atom_t length
|
cdef public atom_t length
|
||||||
cdef public atom_t lex_pos
|
cdef public atom_t postype
|
||||||
cdef public atom_t lex_supersense
|
cdef public atom_t sensetype
|
||||||
|
|
||||||
cdef public atom_t sic
|
cdef public atom_t sic
|
||||||
cdef public atom_t norm
|
cdef public atom_t norm
|
||||||
|
|
|
@ -105,11 +105,12 @@ cdef class Token:
|
||||||
self.idx = idx
|
self.idx = idx
|
||||||
self.pos = pos
|
self.pos = pos
|
||||||
self.i = i
|
self.i = i
|
||||||
|
self.id = lex['id']
|
||||||
|
|
||||||
self.cluster = lex['cluster']
|
self.cluster = lex['cluster']
|
||||||
self.length = lex['length']
|
self.length = lex['length']
|
||||||
self.lex_pos = lex['pos']
|
self.postype = lex['postype']
|
||||||
self.lex_supersense = lex['supersense']
|
self.sensetype = lex['supersense']
|
||||||
self.sic = lex['sic']
|
self.sic = lex['sic']
|
||||||
self.norm = lex['norm']
|
self.norm = lex['norm']
|
||||||
self.shape = lex['shape']
|
self.shape = lex['shape']
|
||||||
|
@ -122,6 +123,8 @@ cdef class Token:
|
||||||
|
|
||||||
property string:
|
property string:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
|
if self.sic == 0:
|
||||||
|
return ''
|
||||||
cdef bytes utf8string = self._string_store[self.sic]
|
cdef bytes utf8string = self._string_store[self.sic]
|
||||||
return utf8string.decode('utf8')
|
return utf8string.decode('utf8')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user