From 9998d9b9ffd18fd4752dad7f77508502b7f2958d Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 25 Sep 2018 20:38:08 +0200 Subject: [PATCH] Start testing morphology class --- spacy/tests/morphology/__init__.py | 0 spacy/tests/morphology/test_morph_features.py | 25 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 spacy/tests/morphology/__init__.py create mode 100644 spacy/tests/morphology/test_morph_features.py diff --git a/spacy/tests/morphology/__init__.py b/spacy/tests/morphology/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/spacy/tests/morphology/test_morph_features.py b/spacy/tests/morphology/test_morph_features.py new file mode 100644 index 000000000..f0610b745 --- /dev/null +++ b/spacy/tests/morphology/test_morph_features.py @@ -0,0 +1,25 @@ +from __future__ import unicode_literals +import pytest + +from ...morphology import Morphology +from ...strings import StringStore +from ...lemmatizer import Lemmatizer +from ...symbols import * + +@pytest.fixture +def morphology(): + return Morphology(StringStore(), {}, Lemmatizer()) + +def test_init(morphology): + pass + +def test_add_tag_with_string_names(morphology): + morphology.add({"Case_gen", "Number_Sing"}) + +def test_add_tag_with_int_ids(morphology): + morphology.add({Case_gen, Number_sing}) + +def test_add_tag_with_mix_strings_and_ints(morphology): + morphology.add({PunctSide_ini, 'VerbType_aux'}) + +