Move files

This commit is contained in:
Andras Schmelczer 2022-07-04 13:55:44 +02:00
parent d2af1b8151
commit f160b07163
159 changed files with 104 additions and 88 deletions

View file

@ -1,16 +0,0 @@
from typing import Optional
from langcodes import Language
from langdetect import LangDetectException, detect
def predict_language(text: Optional[str]) -> str:
if not text:
return Language.make().to_tag()
try:
language_code = detect(text)
except LangDetectException:
return Language.make().to_tag()
return Language.get(language_code).to_tag()