mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-14 18:40:33 +03:00
Add test for #4248, clean up test
This commit is contained in:
parent
e7e7c942c7
commit
e74963acd4
|
@ -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_", "."]
|
||||
|
|
Loading…
Reference in New Issue
Block a user