From 99e44fbdbbb34f33f3a02890cec03bea2b0a4b74 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 6 Sep 2017 19:13:51 +0200 Subject: [PATCH] Update regression test --- spacy/tests/regression/test_issue429.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/spacy/tests/regression/test_issue429.py b/spacy/tests/regression/test_issue429.py index 1baa9a1db..74f12bd9f 100644 --- a/spacy/tests/regression/test_issue429.py +++ b/spacy/tests/regression/test_issue429.py @@ -9,11 +9,14 @@ import pytest @pytest.mark.models('en') def test_issue429(EN): def merge_phrases(matcher, doc, i, matches): - if i != len(matches) - 1: - return None - spans = [(ent_id, ent_id, doc[start:end]) for ent_id, start, end in matches] - for ent_id, label, span in spans: - span.merge('NNP' if label else span.root.tag_, span.text, EN.vocab.strings[label]) + if i != len(matches) - 1: + return None + spans = [(ent_id, ent_id, doc[start:end]) for ent_id, start, end in matches] + for ent_id, label, span in spans: + span.merge( + tag=('NNP' if label else span.root.tag_), + lemma=span.text, + label='PERSON') doc = EN('a') matcher = Matcher(EN.vocab)