mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-14 05:37:03 +03:00
7ed7908716
* Add support basic support for upper sorbian. * Add tokenizer exceptions and tests. * Update spacy/lang/hsb/examples.py Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
26 lines
566 B
Python
26 lines
566 B
Python
import pytest
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"text,match",
|
|
[
|
|
("10", True),
|
|
("1", True),
|
|
("10,000", True),
|
|
("10,00", True),
|
|
("jedne", True),
|
|
("dwanaće", True),
|
|
("milion", True),
|
|
("sto", True),
|
|
("załožene", False),
|
|
("wona", False),
|
|
("powšitkownej", False),
|
|
(",", False),
|
|
("1/2", True),
|
|
],
|
|
)
|
|
def test_lex_attrs_like_number(hsb_tokenizer, text, match):
|
|
tokens = hsb_tokenizer(text)
|
|
assert len(tokens) == 1
|
|
assert tokens[0].like_num == match
|