From 5f3365369c28b7a513d01c3308733e3f5d5899fd Mon Sep 17 00:00:00 2001 From: Oleg Korsak Date: Wed, 14 May 2025 19:28:29 +0300 Subject: [PATCH] made code building again. --- spacy/lexeme.pyx | 4 ++-- spacy/matcher/phrasematcher.pyx | 2 +- spacy/pipeline/_parser_internals/ner.pyx | 2 +- spacy/pipeline/_parser_internals/transition_system.pyx | 3 +-- spacy/vectors.pyx | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/spacy/lexeme.pyx b/spacy/lexeme.pyx index 7a0c19bf3..8886dde01 100644 --- a/spacy/lexeme.pyx +++ b/spacy/lexeme.pyx @@ -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)) diff --git a/spacy/matcher/phrasematcher.pyx b/spacy/matcher/phrasematcher.pyx index 4efcdb05c..ccc830e35 100644 --- a/spacy/matcher/phrasematcher.pyx +++ b/spacy/matcher/phrasematcher.pyx @@ -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: diff --git a/spacy/pipeline/_parser_internals/ner.pyx b/spacy/pipeline/_parser_internals/ner.pyx index 439c97d84..84d8ed220 100644 --- a/spacy/pipeline/_parser_internals/ner.pyx +++ b/spacy/pipeline/_parser_internals/ner.pyx @@ -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 diff --git a/spacy/pipeline/_parser_internals/transition_system.pyx b/spacy/pipeline/_parser_internals/transition_system.pyx index d7cf95c8c..c859135d9 100644 --- a/spacy/pipeline/_parser_internals/transition_system.pyx +++ b/spacy/pipeline/_parser_internals/transition_system.pyx @@ -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 diff --git a/spacy/vectors.pyx b/spacy/vectors.pyx index 6ff99bb59..d1fb9a747 100644 --- a/spacy/vectors.pyx +++ b/spacy/vectors.pyx @@ -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()