Move files
This commit is contained in:
parent
3cf28379e8
commit
00cc8225c5
159 changed files with 31 additions and 49 deletions
11
great_ai/utilities/language/is_english.py
Normal file
11
great_ai/utilities/language/is_english.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
from typing import Optional
|
||||
|
||||
from langcodes import standardize_tag, tag_distance
|
||||
|
||||
|
||||
def is_english(language_code: Optional[str]) -> bool:
|
||||
if not language_code:
|
||||
language_code = "und"
|
||||
|
||||
language_code = standardize_tag(language_code)
|
||||
return tag_distance(language_code, "en") < 15
|
||||
Loading…
Add table
Add a link
Reference in a new issue