From ec7739b76e2f37e1221888a5fa49828694039544 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Thu, 12 Jan 2017 11:12:44 +0100 Subject: [PATCH] Add regression test for #736 --- spacy/tests/regression/test_issue736.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 spacy/tests/regression/test_issue736.py diff --git a/spacy/tests/regression/test_issue736.py b/spacy/tests/regression/test_issue736.py new file mode 100644 index 000000000..51f2b8714 --- /dev/null +++ b/spacy/tests/regression/test_issue736.py @@ -0,0 +1,17 @@ +# coding: utf-8 +"""Test that times like "7am" are tokenized correctly and that numbers are converted to string.""" + + +from __future__ import unicode_literals + +import pytest + + +@pytest.mark.xfail +@pytest.mark.parametrize('text,number', [("7am", "7"), ("11p.m.", "11")]) +def test_issue736(en_tokenizer, text, number): + tokens = en_tokenizer(text) + assert len(tokens) == 2 + assert tokens[0].text == number + assert tokens[0].lemma_ == number + assert tokens[0].pos_ == 'NUM'