mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +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>
28 lines
1018 B
Python
28 lines
1018 B
Python
import pytest
|
|
|
|
|
|
def test_long_text(lv_tokenizer):
|
|
# Excerpt: European Convention on Human Rights
|
|
text = """
|
|
Ievērodamas, ka šī deklarācija paredz nodrošināt vispārēju un
|
|
efektīvu tajā pasludināto tiesību atzīšanu un ievērošanu;
|
|
Ievērodamas, ka Eiropas Padomes mērķis ir panākt lielāku vienotību
|
|
tās dalībvalstu starpā un ka viens no līdzekļiem, kā šo mērķi
|
|
sasniegt, ir cilvēka tiesību un pamatbrīvību ievērošana un turpmāka
|
|
īstenošana;
|
|
No jauna apliecinādamas patiesu pārliecību, ka šīs pamatbrīvības
|
|
ir taisnīguma un miera pamats visā pasaulē un ka tās vislabāk var
|
|
nodrošināt patiess demokrātisks politisks režīms no vienas puses un
|
|
vispārējo cilvēktiesību, uz kurām tās pamatojas, kopīga izpratne un
|
|
ievērošana no otras puses;
|
|
"""
|
|
tokens = lv_tokenizer(text)
|
|
assert len(tokens) == 109
|
|
|
|
|
|
@pytest.mark.xfail
|
|
def test_ordinal_number(lv_tokenizer):
|
|
text = "10. decembrī"
|
|
tokens = lv_tokenizer(text)
|
|
assert len(tokens) == 2
|