<commit_before># 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", "sv", "ta", "te", "tl", "tr", "tt", "ur"]
# fmt: on


@pytest.mark.parametrize("lang", LANGUAGES)
def test_lang_initialize(lang):
    """Test that languages can be initialized."""
    lang_cls = get_lang_class(lang)()  # noqa: F841<commit_msg>Add test for stray print statements in languages (see #3342)<commit_after># 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", "sv", "ta", "te", "tl", "tr", "tt", "ur"]
# fmt: on


@pytest.mark.parametrize("lang", LANGUAGES)
def test_lang_initialize(lang, capfd):
    """Test that languages can be initialized."""
    nlp = get_lang_class(lang)()  # noqa: F841
    # Check for stray print statements (see #3342)
    doc = nlp("test")
    captured = capfd.readouterr()
    assert not captured.out
{'fraction_non_alphanumeric': 0.2196601941747573, 'fraction_numerical': 0.009708737864077669, 'mean_word_length': 3.7114285714285713, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3813313', 'n_tokens_mistral': 629, 'n_tokens_neox': 612, 'n_words': 199}