conversion changes audit from one particular user

This commit is contained in:
Ubuntu 2024-06-19 07:31:14 +00:00
parent 6e15d10fd0
commit 7cd8c3946a
2 changed files with 11 additions and 7 deletions

View File

@ -461,11 +461,15 @@ def translate_comparison2(text, source_lang, target_lang, script_data=None, subs
if is_dialogue:
tokenizers_valid_langs = ("malayalam", "french", "italian", "german", "spanish", "swedish", "finnish", "danish", "english", "slovene", "norwegian", "dutch", "portuguese", "czech", "russian", "polish","turkish", "estonian", "greek")
try:
if code_2_language[source_lang].lower() in tokenizers_valid_langs:
sentences = sent_tokenize(text, language=(code_2_language[source_lang]).lower())
else:
sentences = text.split(".")
except Exception as e:
print("Error was : ", e)
return text
if code_2_language[source_lang].lower() in tokenizers_valid_langs:
sentences = sent_tokenize(text, language=(code_2_language[source_lang]).lower())
else:
sentences = text.split(".")
# List of translated sentences
translated_text = []

View File

@ -194,6 +194,6 @@ def checker(text, src_lang, tar_lang):
# end_time = time.time()
# print("Time took is ->", end_time - start_time)
print("Prince was Here!!!")
text = "Amazing to see everything alright."
checker(text, 'en', 'el')
# print("Prince was Here!!!")
# text = "Amazing to see everything alright."
# checker(text, 'en', 'el')