mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-14 05:37:03 +03:00
7b134b8fbd
* Added Slovak * Added Slovenian tests * Added Estonian tests * Added Croatian tests * Added Latvian tests * Added Icelandic tests * Added Afrikaans tests * Added language-independent tests * Added Kannada tests * Tidied up * Added Albanian tests * Formatted with black * Added failing tests for anomalies * Update spacy/tests/lang/af/test_text.py Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com> * Added context to failing Estonian tokenizer test Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com> * Added context to failing Croatian tokenizer test Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com> * Added context to failing Icelandic tokenizer test Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com> * Added context to failing Latvian tokenizer test Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com> * Added context to failing Slovak tokenizer test Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com> * Added context to failing Slovenian tokenizer test Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com> Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
27 lines
954 B
Python
27 lines
954 B
Python
import pytest
|
|
|
|
|
|
def test_long_text(hr_tokenizer):
|
|
# Excerpt: European Convention on Human Rights
|
|
text = """
|
|
uzimajući u obzir da ta deklaracija nastoji osigurati opće i djelotvorno
|
|
priznanje i poštovanje u njoj proglašenih prava;
|
|
uzimajući u obzir da je cilj Vijeća Europe postizanje većeg jedinstva
|
|
njegovih članica, i da je jedan od načina postizanja toga cilja
|
|
očuvanje i daljnje ostvarivanje ljudskih prava i temeljnih sloboda;
|
|
potvrđujući svoju duboku privrženost tim temeljnim slobodama
|
|
koje su osnova pravde i mira u svijetu i koje su najbolje zaštićene
|
|
istinskom političkom demokracijom s jedne strane te zajedničkim
|
|
razumijevanjem i poštovanjem ljudskih prava o kojima te slobode
|
|
ovise s druge strane;
|
|
"""
|
|
tokens = hr_tokenizer(text)
|
|
assert len(tokens) == 105
|
|
|
|
|
|
@pytest.mark.xfail
|
|
def test_ordinal_number(hr_tokenizer):
|
|
text = "10. prosinca 1948"
|
|
tokens = hr_tokenizer(text)
|
|
assert len(tokens) == 3
|