From e854f28304bfea7d7b80e2f52d8a514418a53553 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 31 Mar 2017 13:26:25 +0200 Subject: [PATCH] Add test for Issue #758 Issue #758 occurs when no actions are available for a single token doc after merging. --- spacy/tests/regression/test_issue758.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 spacy/tests/regression/test_issue758.py diff --git a/spacy/tests/regression/test_issue758.py b/spacy/tests/regression/test_issue758.py new file mode 100644 index 000000000..0dac5737b --- /dev/null +++ b/spacy/tests/regression/test_issue758.py @@ -0,0 +1,17 @@ +from ... import load as load_spacy +from ...attrs import LEMMA +from ...matcher import merge_phrase + +import pytest + + + + +@pytest.mark.models +def test_issue758(): + '''Test parser transition bug after label added.''' + nlp = load_spacy('en') + nlp.matcher.add('splash', 'my_entity', {}, + [[{LEMMA: 'splash'}, {LEMMA: 'on'}]], + on_match=merge_phrase) + doc = nlp('splash On')