ai-content-maker/.venv/Lib/site-packages/dateparser/custom_language_detection/language_mapping.py

19 lines
557 B
Python
Raw Permalink Normal View History

2024-05-03 04:18:51 +03:00
from dateparser.data.languages_info import language_map
def map_languages(language_codes):
"""
Returns the candidates from the supported languages codes.
:param language_codes:
A list of language codes, e.g. ['en', 'es'] in ISO 639 Standard.
:type language_codes: list
:return: Returns list[str] representing supported languages
:rtype: list[str]
"""
return [
language_code
for language in language_codes
if language in language_map
for language_code in language_map[language]
]