Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -43,7 +43,7 @@ def is_romanized_indic(text: str) -> bool:
|
|
43 |
|
44 |
text_lower = text.lower()
|
45 |
matches = sum(1 for pattern in bengali_patterns if re.search(pattern, text_lower))
|
46 |
-
return matches >=
|
47 |
|
48 |
def translate_text(text: str, target_lang='en') -> tuple[str, str, bool]:
|
49 |
"""Translate text to target language, with more conservative translation logic."""
|
|
|
43 |
|
44 |
text_lower = text.lower()
|
45 |
matches = sum(1 for pattern in bengali_patterns if re.search(pattern, text_lower))
|
46 |
+
return matches >= 2 # Require at least 2 matches to consider it Bengali
|
47 |
|
48 |
def translate_text(text: str, target_lang='en') -> tuple[str, str, bool]:
|
49 |
"""Translate text to target language, with more conservative translation logic."""
|