<filename>lumi_language_id/tests/test_language_id.py<gh_stars>1-10
from lumi_language_id.tuned import TunedLanguageIdentifier


LID = TunedLanguageIdentifier.load()


def _get_language(text):
    lang, prob = LID.detect_language(text)
    return lang


def test_language_id():
    assert _get_language("here's some words") == 'en'
    assert _get_language("aquí hay algunas palabras") == 'es'
    assert _get_language("これらは言葉です") == 'ja'
    assert _get_language("这些是单词") == 'zh'

<filename>lumi_language_id/tests/test_language_id.py<gh_stars>1-10
from lumi_language_id.tuned import TunedLanguageIdentifier


LID = TunedLanguageIdentifier.load()


def _get_language(text):
    lang, prob = LID.detect_language(text)
    return lang


def test_language_id():
    assert _get_language("here's some words") == 'en'
    assert _get_language("aquí hay algunas palabras") == 'es'
    assert _get_language("これらは言葉です") == 'ja'
    assert _get_language("这些是单词") == 'zh'
