made code building again.

This commit is contained in:
Oleg Korsak 2025-05-14 19:28:29 +03:00
parent fbf845dfc9
commit 5f3365369c
5 changed files with 6 additions and 7 deletions

View File

@ -70,7 +70,7 @@ cdef class Lexeme:
if isinstance(other, Lexeme):
a = self.orth
b = other.orth
elif isinstance(other, long):
elif isinstance(other, int):
a = self.orth
b = other
elif isinstance(other, str):
@ -104,7 +104,7 @@ cdef class Lexeme:
# skip PROB, e.g. from lexemes.jsonl
if isinstance(value, float):
continue
elif isinstance(value, (int, long)):
elif isinstance(value, int):
Lexeme.set_struct_attr(self.c, attr, value)
else:
Lexeme.set_struct_attr(self.c, attr, self.vocab.strings.add(value))

View File

@ -47,7 +47,7 @@ cdef class PhraseMatcher:
self._terminal_hash = 826361138722620965
map_init(self.mem, self.c_map, 8)
if isinstance(attr, (int, long)):
if isinstance(attr, int):
self.attr = attr
else:
if attr is None:

View File

@ -238,7 +238,7 @@ cdef class BiluoPushDown(TransitionSystem):
def add_action(self, int action, label_name, freq=None):
cdef attr_t label_id
if not isinstance(label_name, (int, long)):
if not isinstance(label_name, int):
label_id = self.strings.add(label_name)
else:
label_id = label_name

View File

@ -191,8 +191,7 @@ cdef class TransitionSystem:
def add_action(self, int action, label_name):
cdef attr_t label_id
if not isinstance(label_name, int) and \
not isinstance(label_name, long):
if not isinstance(label_name, int):
label_id = self.strings.add(label_name)
else:
label_id = label_name

View File

@ -177,7 +177,7 @@ cdef class Vectors(BaseVectors):
self.hash_seed = hash_seed
self.bow = bow
self.eow = eow
if isinstance(attr, (int, long)):
if isinstance(attr, int):
self.attr = attr
else:
attr = attr.upper()