mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
make highlight friendly to English (#2417)
### What problem does this PR solve? #2415 ### Type of change - [x] Performance Improvement
This commit is contained in:
@ -214,7 +214,7 @@ def is_english(texts):
|
||||
eng = 0
|
||||
if not texts: return False
|
||||
for t in texts:
|
||||
if re.match(r"[a-zA-Z]{2,}", t.strip()):
|
||||
if re.match(r"[ `a-zA-Z.,':;/\"?<>!\(\)-]", t.strip()):
|
||||
eng += 1
|
||||
if eng / len(texts) > 0.8:
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user