From 34a3cc26a91e50ee2461df650271fb50c064562b Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Tue, 12 Feb 2019 14:49:59 +0100 Subject: [PATCH] Add xfailing test for reverse pattern (see #1971) --- spacy/tests/regression/test_issue1971.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spacy/tests/regression/test_issue1971.py b/spacy/tests/regression/test_issue1971.py index 9d5a83c5b..115e1e51c 100644 --- a/spacy/tests/regression/test_issue1971.py +++ b/spacy/tests/regression/test_issue1971.py @@ -23,3 +23,14 @@ def test_issue1971(en_vocab): # the real problem here is that it returns a duplicate match for a match_id # that's not actually in the vocab! assert all(match_id in en_vocab.strings for match_id, start, end in matcher(doc)) + + +@pytest.mark.xfail +def test_issue_1971_2(en_vocab): + matcher = Matcher(en_vocab) + pattern1 = [{"LOWER": {"IN": ["eur"]}}, {"LIKE_NUM": True}] + pattern2 = list(reversed(pattern1)) + doc = Doc(en_vocab, words=["EUR", "10", "is", "10", "EUR"]) + matcher.add("TEST", None, pattern1, pattern2) + matches = matcher(doc) + assert len(matches) == 2