From bf0aff51242148914b7a23eba58fae2f9549ab0f Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 13 Apr 2015 21:34:33 +0200 Subject: [PATCH] * Fix bug in Tokens.ents where entity wasn't being emitted if another started immediately after --- spacy/tokens.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spacy/tokens.pyx b/spacy/tokens.pyx index 411f5cd95..b61302c24 100644 --- a/spacy/tokens.pyx +++ b/spacy/tokens.pyx @@ -158,6 +158,8 @@ cdef class Tokens: start = -1 label = 0 elif token.ent_iob == 3: + if start != -1: + yield Span(self, start, i, label=label) start = i label = token.ent_type if start != -1: