From 51882ee2b8954f71ddd29ca8bd4cf7b0835b0d41 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 31 Mar 2017 19:32:01 +0200 Subject: [PATCH] Fix check for setting ent_id in merge --- spacy/tokens/doc.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/tokens/doc.pyx b/spacy/tokens/doc.pyx index ad5141a08..bffc8bbdf 100644 --- a/spacy/tokens/doc.pyx +++ b/spacy/tokens/doc.pyx @@ -697,7 +697,7 @@ cdef class Doc: lemma = self.vocab.strings[attributes.get(LEMMA, span.root.lemma)] ent_type = self.vocab.strings[attributes.get(ENT_TYPE, span.root.ent_type)] ent_id = attributes.get('ent_id', span.root.ent_id) - if not isinstance(ent_id, int): + if isinstance(ent_id, basestring): ent_id = self.vocab.strings[ent_id] # Get LexemeC for newly merged token