7th_fix doc
This commit is contained in:
@@ -307,15 +307,11 @@ class ExcelParser(DocumentParser):
|
||||
return None
|
||||
|
||||
def _should_translate(self, text: str, src_lang: str) -> bool:
|
||||
"""判斷文字是否需要翻譯(修正中文長度判斷)"""
|
||||
"""判斷文字是否需要翻譯(只要有字就翻譯)"""
|
||||
text = text.strip()
|
||||
|
||||
# 檢查是否包含中日韓文字
|
||||
has_cjk = self._has_cjk(text)
|
||||
|
||||
# 對於包含CJK字符的文字,放寬長度限制為2個字符
|
||||
min_length = 2 if has_cjk else 3
|
||||
if len(text) < min_length:
|
||||
# 只要有字就翻譯 - 最小長度設為1
|
||||
if len(text) < 1:
|
||||
return False
|
||||
|
||||
# Skip pure numbers, dates, etc.
|
||||
|
Reference in New Issue
Block a user