* Add senses flag to Lexeme

This commit is contained in:
Matthew Honnibal 2015-07-01 20:10:41 +02:00
parent e23d1582a2
commit 2b8459d9a8
1 changed files with 4 additions and 0 deletions

View File

@ -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)