mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-05 04:40:20 +03:00
Add tests for all custom lex attrs
This commit is contained in:
parent
01829933fd
commit
8fc4152297
18
spacy/tests/lang/sr/test_lex_attrs.py
Normal file
18
spacy/tests/lang/sr/test_lex_attrs.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import pytest
|
||||||
|
from spacy.lang.sr.lex_attrs import like_num, norm, prefix, suffix
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
"text,like_num,norm,prefix,suffix",
|
||||||
|
[
|
||||||
|
("нула", True, "nula", "n", "ula"),
|
||||||
|
("Казна", False, "kazna", "K", "zna"),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
def test_lex_attrs(sr_tokenizer, text, like_num, norm, prefix, suffix):
|
||||||
|
tokens = sr_tokenizer(text)
|
||||||
|
assert len(tokens) == 1
|
||||||
|
assert tokens[0].like_num == like_num
|
||||||
|
assert tokens[0].norm_ == norm
|
||||||
|
assert tokens[0].prefix_ == prefix
|
||||||
|
assert tokens[0].suffix_ == suffix
|
Loading…
Reference in New Issue
Block a user