From 68ee0384fd4fb771f5ac32391b61d9442130d53d Mon Sep 17 00:00:00 2001 From: Sofie Van Landeghem Date: Tue, 20 Aug 2019 16:40:25 +0200 Subject: [PATCH] Unit test for Issue 3879 (#4153) * failing unit test for Issue #3879 * mark test as failing --- spacy/tests/regression/test_issue3879.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 spacy/tests/regression/test_issue3879.py diff --git a/spacy/tests/regression/test_issue3879.py b/spacy/tests/regression/test_issue3879.py new file mode 100644 index 000000000..0eed8bb81 --- /dev/null +++ b/spacy/tests/regression/test_issue3879.py @@ -0,0 +1,21 @@ +# coding: utf8 +from __future__ import unicode_literals + +import pytest +from spacy.lang.en import English +from spacy.matcher import Matcher + + +@pytest.mark.xfail +def test_issue3879(en_vocab): + nlp = English() + text = "This is a test." + doc = nlp(text) + assert len(doc) == 5 + + pattern = [{"ORTH": "This", "OP": "?"}, {"OP": "?"}, {"ORTH": "test"}] + matcher = Matcher(nlp.vocab) + matcher.add("rule", None, pattern) + matches = matcher(doc) + + assert len(matches) == 2 # fails because of a FP match 'is a test'