mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 10:46:29 +03:00
* Fix 32bit/64bit int problem when setting flags
This commit is contained in:
parent
4c6533a019
commit
5e0545be5c
|
@ -34,8 +34,6 @@ cdef int set_lex_struct_props(LexemeC* lex, dict props, StringStore string_store
|
|||
for _sense_id in props.get('senses', []):
|
||||
sense_id = _sense_id
|
||||
lex.senses |= one << sense_id
|
||||
if lex.senses != one:
|
||||
assert not (lex.senses & (1 << 0)), (lex.senses, props)
|
||||
lex.repvec = empty_vec
|
||||
|
||||
|
||||
|
@ -53,7 +51,9 @@ cdef class Lexeme:
|
|||
return self.l2_norm != 0
|
||||
|
||||
cpdef bint check(self, attr_id_t flag_id) except -1:
|
||||
return self.flags & (1 << flag_id)
|
||||
cdef flags_t one = 1
|
||||
return self.flags & (one << flag_id)
|
||||
|
||||
cpdef bint has_sense(self, flags_t flag_id) except -1:
|
||||
return self.senses & (1 << flag_id)
|
||||
cdef flags_t one = 1
|
||||
return self.senses & (one << flag_id)
|
||||
|
|
Loading…
Reference in New Issue
Block a user