Add test for #4248, clean up test

This commit is contained in:
Adriane Boyd 2019-09-20 09:20:57 +02:00
parent e7e7c942c7
commit e74963acd4

View File

@ -133,5 +133,11 @@ def test_tokenizer_special_cases_with_affixes(tokenizer):
tokenizer.add_special_case("_SPECIAL_", [{"orth": "_SPECIAL_"}])
tokenizer.add_special_case("A/B", [{"orth": "A/B"}])
doc = tokenizer(text)
print([token.text for token in doc])
assert [token.text for token in doc] == ["(", "(", "(", "_SPECIAL_", "A/B", ",", "A/B", "-", "A/B", '"', ")"]
def test_tokenizer_special_cases_with_period(tokenizer):
text = "_SPECIAL_."
tokenizer.add_special_case("_SPECIAL_", [{"orth": "_SPECIAL_"}])
doc = tokenizer(text)
assert [token.text for token in doc] == ["_SPECIAL_", "."]