From aefb898e376fe44e2cabf34b272644a49173ceb3 Mon Sep 17 00:00:00 2001 From: ines Date: Sat, 18 Mar 2017 17:27:11 +0100 Subject: [PATCH] Add title-case version of morph rules (resolves #686) --- spacy/en/morph_rules.py | 5 +++++ spacy/tests/regression/test_issue686.py | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/spacy/en/morph_rules.py b/spacy/en/morph_rules.py index 129ae799f..2b8aae823 100644 --- a/spacy/en/morph_rules.py +++ b/spacy/en/morph_rules.py @@ -68,3 +68,8 @@ MORPH_RULES = { "were": {LEMMA: "be", "VerbForm": "Fin", "Tense": "Past", "Number": "Plur"} } } + + +for tag, rules in MORPH_RULES.items(): + for key, attrs in dict(rules).items(): + rules[key.title()] = attrs diff --git a/spacy/tests/regression/test_issue686.py b/spacy/tests/regression/test_issue686.py index 2ca882514..d3807808a 100644 --- a/spacy/tests/regression/test_issue686.py +++ b/spacy/tests/regression/test_issue686.py @@ -4,9 +4,8 @@ from __future__ import unicode_literals import pytest -@pytest.mark.xfail @pytest.mark.models -@pytest.mark.parametrize('text', ["He is the man.", "They are the men."]) +@pytest.mark.parametrize('text', ["He is the man", "he is the man"]) def test_issue686(EN, text): """Test that pronoun lemmas are assigned correctly.""" tokens = EN(text)