mirror of
https://github.com/nexus-stc/hyperboria
synced 2024-12-21 09:07:46 +01:00
8 lines
175 B
Python
8 lines
175 B
Python
|
import cld3
|
||
|
|
||
|
|
||
|
def detect_language(text: str) -> str:
|
||
|
prediction = cld3.get_language(text)
|
||
|
if prediction and prediction.is_reliable:
|
||
|
return prediction.language
|