mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
a741de7cf6
* Adding Support for Yoruba * test text * Updated test string. * Fixing encoding declaration. * Adding encoding to stop_words.py * Added contributor agreement and removed iranlowo. * Added removed test files and removed iranlowo to keep project bare. * Returned CONTRIBUTING.md to default state. * Added delted conftest entries * Tidy up and auto-format * Revert CONTRIBUTING.md Co-authored-by: Ines Montani <ines@ines.io>
26 lines
855 B
Python
26 lines
855 B
Python
# coding: utf-8
|
|
from __future__ import unicode_literals
|
|
|
|
import pytest
|
|
from spacy.util import get_lang_class
|
|
|
|
|
|
# fmt: off
|
|
# Only include languages with no external dependencies
|
|
# excluded: ja, ru, th, uk, vi, zh
|
|
LANGUAGES = ["af", "ar", "bg", "bn", "ca", "cs", "da", "de", "el", "en", "es",
|
|
"et", "fa", "fi", "fr", "ga", "he", "hi", "hr", "hu", "id", "is",
|
|
"it", "kn", "lt", "lv", "nb", "nl", "pl", "pt", "ro", "si", "sk",
|
|
"sl", "sq", "sr", "sv", "ta", "te", "tl", "tr", "tt", "ur", 'yo']
|
|
# fmt: on
|
|
|
|
|
|
@pytest.mark.parametrize("lang", LANGUAGES)
|
|
def test_lang_initialize(lang, capfd):
|
|
"""Test that languages can be initialized."""
|
|
nlp = get_lang_class(lang)()
|
|
# Check for stray print statements (see #3342)
|
|
doc = nlp("test") # noqa: F841
|
|
captured = capfd.readouterr()
|
|
assert not captured.out
|