From 34a157511f85715ca2d8f5d2e37a31abed400403 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 16 Jan 2016 18:00:26 +0100 Subject: [PATCH] * Move test_merge_hang to test_tokens_api --- spacy/tests/tokens/test_tokens_api.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spacy/tests/tokens/test_tokens_api.py b/spacy/tests/tokens/test_tokens_api.py index 794a29bcb..9224880ac 100644 --- a/spacy/tests/tokens/test_tokens_api.py +++ b/spacy/tests/tokens/test_tokens_api.py @@ -148,3 +148,13 @@ def test_merge_children(EN): assert word in list(word.head.lefts) elif word.i > word.head.i: assert word in list(word.head.rights) + + +def test_merge_hang(): + text = 'through North and South Carolina' + EN = English(parser=False) + doc = EN(text, tag=True) + heads = np.asarray([[0, 3, -1, -2, -4]], dtype='int32') + doc.from_array([HEAD], heads.T) + doc.merge(18, 32, '', '', 'ORG') + doc.merge(8, 32, '', '', 'ORG')