From 597df5bf83b504f36735182f26cef0f0314eed7a Mon Sep 17 00:00:00 2001 From: Kevin Humphreys Date: Wed, 3 Jan 2018 13:00:05 -0800 Subject: [PATCH] add test --- spacy/tests/regression/test_issue1758.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 spacy/tests/regression/test_issue1758.py diff --git a/spacy/tests/regression/test_issue1758.py b/spacy/tests/regression/test_issue1758.py new file mode 100644 index 000000000..2c10591e0 --- /dev/null +++ b/spacy/tests/regression/test_issue1758.py @@ -0,0 +1,13 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import pytest + + +@pytest.mark.parametrize('text', ["would've"]) +def test_issue1758(en_tokenizer, text): + """Test that "would've" is handled by the English tokenizer exceptions.""" + tokens = en_tokenizer(text) + assert len(tokens) == 2 + assert tokens[0].tag_ == "MD" + assert tokens[1].lemma_ == "have"