This commit is contained in:
hsafaei
2025-09-18 15:48:59 +03:30
parent b4d5671809
commit b005ef64ea
4 changed files with 124 additions and 11 deletions
+2 -2
View File
@@ -75,8 +75,7 @@ class TextNormalizer:
text = re.sub(r"(\n)+", "\n", text)
# نرمال کردن حروف اختلافی عربی و فارسی
text = text.replace("ي", "ی")
text = text.replace("ك", "ک")
text = self.yeke_normal(text)
return text
@@ -279,6 +278,7 @@ class TextNormalizer:
text = re.sub(r'([\u0600-\u06FF])ـ([\u0600-\u06FF])', r'\1\2', text) # حذف حروف کشیده
text = re.sub(r'([\u0600-\u06FF])ـ', r'\1', text) # حذف حروف کشیده
text = text.strip("\u200C").strip()
return text