mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-27 10:26:35 +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
980 B
Python
27 lines
980 B
Python
import pytest
|
|
|
|
|
|
def test_long_text(is_tokenizer):
|
|
# Excerpt: European Convention on Human Rights
|
|
text = """
|
|
hafa í huga, að yfirlýsing þessi hefur það markmið að tryggja
|
|
almenna og raunhæfa viðurkenningu og vernd þeirra réttinda,
|
|
sem þar er lýst;
|
|
hafa í huga, að markmið Evrópuráðs er að koma á nánari einingu
|
|
aðildarríkjanna og að ein af leiðunum að því marki er sú, að
|
|
mannréttindi og mannfrelsi séu í heiðri höfð og efld;
|
|
lýsa á ný eindreginni trú sinni á það mannfrelsi, sem er undirstaða
|
|
réttlætis og friðar í heiminum og best er tryggt, annars vegar með
|
|
virku, lýðræðislegu stjórnarfari og, hins vegar, almennum skilningi
|
|
og varðveislu þeirra mannréttinda, sem eru grundvöllur frelsisins;
|
|
"""
|
|
tokens = is_tokenizer(text)
|
|
assert len(tokens) == 120
|
|
|
|
|
|
@pytest.mark.xfail
|
|
def test_ordinal_number(is_tokenizer):
|
|
text = "10. desember 1948"
|
|
tokens = is_tokenizer(text)
|
|
assert len(tokens) == 3
|