@@ -0,0 +1,804 @@
+from __future__ import unicode_literals%0Aimport pytest%0A%0Aimport spacy%0Afrom spacy.attrs import ORTH%0A%0A%0A@pytest.mark.models%0Adef test_issue429():%0A%0A    nlp = spacy.load('en', parser=False)%0A%0A%0A    def merge_phrases(matcher, doc, i, matches):%0A      if i != len(matches) - 1:%0A        return None%0A      spans = %5B(ent_id, label, doc%5Bstart:end%5D) for ent_id, label, start, end in matches%5D%0A      for ent_id, label, span in spans:%0A        span.merge('NNP' if label else span.root.tag_, span.text, nlp.vocab.strings%5Blabel%5D)%0A%0A    doc = nlp('a')%0A    nlp.matcher.add('key', label='TEST', attrs=%7B%7D, specs=%5B%5B%7BORTH: 'a'%7D%5D%5D, on_match=merge_phrases)%0A    doc = nlp.tokenizer('a b c')%0A    nlp.tagger(doc)%0A    nlp.matcher(doc)%0A        %0A    for word in doc:%0A        print(word.text, word.ent_iob_, word.ent_type_)%0A    nlp.entity(doc)%0A

Test Issue 429: No valid actions for NER after matcher adds a new entity label.