refactor
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user