mirror of https://github.com/explosion/spaCy.git
* Add senses flag to Lexeme
This commit is contained in:
parent
e23d1582a2
commit
2b8459d9a8
|
@ -17,6 +17,7 @@ cdef class Lexeme:
|
|||
cdef readonly ndarray repvec
|
||||
|
||||
cdef readonly flags_t flags
|
||||
cdef readonly flags_t senses
|
||||
cdef readonly attr_t id
|
||||
cdef readonly attr_t length
|
||||
|
||||
|
@ -48,6 +49,7 @@ cdef class Lexeme:
|
|||
py.repvec[i] = ptr.repvec[i]
|
||||
py.l2_norm = ptr.l2_norm
|
||||
py.flags = ptr.flags
|
||||
py.senses = ptr.senses
|
||||
py.id = ptr.id
|
||||
py.length = ptr.length
|
||||
|
||||
|
@ -72,6 +74,8 @@ cdef class Lexeme:
|
|||
|
||||
cpdef bint check(self, attr_id_t flag_id) except -1
|
||||
|
||||
cpdef bint has_sense(self, flags_t flag_id) except -1
|
||||
|
||||
|
||||
cdef inline bint check_flag(const LexemeC* lexeme, attr_id_t flag_id) nogil:
|
||||
return lexeme.flags & (1 << flag_id)
|
||||
|
|
Loading…
Reference in New Issue