From 80195bc2d161df5c1f0740596413c9fdbc951c02 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 21 Feb 2019 09:48:53 +0100 Subject: [PATCH] Fix issue #3288 (#3308) --- spacy/tests/regression/test_issue3288.py | 1 - spacy/tokens/_retokenize.pyx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/spacy/tests/regression/test_issue3288.py b/spacy/tests/regression/test_issue3288.py index 5379a585a..f196fcc05 100644 --- a/spacy/tests/regression/test_issue3288.py +++ b/spacy/tests/regression/test_issue3288.py @@ -8,7 +8,6 @@ from spacy import displacy from ..util import get_doc -@pytest.mark.xfail def test_issue3288(en_vocab): """Test that retokenization works correctly via displaCy when punctuation is merged onto the preceeding token and tensor is resized.""" diff --git a/spacy/tokens/_retokenize.pyx b/spacy/tokens/_retokenize.pyx index 0355e3200..fd621922f 100644 --- a/spacy/tokens/_retokenize.pyx +++ b/spacy/tokens/_retokenize.pyx @@ -222,7 +222,7 @@ def _bulk_merge(Doc doc, merges): # whether the row is to be deleted, then use numpy.delete if doc.tensor is not None and doc.tensor.size != 0: doc.tensor = _resize_tensor(doc.tensor, - [(m[1][0].start, m[1][0].end) for m in merges]) + [(m[0].start, m[0].end) for m in merges]) # Memorize span roots and sets dependencies of the newly merged # tokens to the dependencies of their roots. span_roots = []