list_tags qanon_usefull
This commit is contained in:
+49
-39
@@ -818,54 +818,64 @@ def save_error(error_text,filename):
|
||||
|
||||
|
||||
|
||||
def getTitleType(caption):
|
||||
title_type = ''
|
||||
caption = normalize_content(caption)
|
||||
# تابع برای تعیین نوع عنوان قانونی
|
||||
def getTitleType(caption: str) -> str:
|
||||
# عادیسازی متن ورودی
|
||||
caption = re.sub(r'\s+', ' ', caption.strip()) # حذف فاصلههای اضافی
|
||||
caption = caption.replace('\u200c', ' ') # جایگزینی نیمفاصلهها با فاصله کامل
|
||||
|
||||
if caption.startswith("الحاق ") or caption.startswith("قانون الحاق "):
|
||||
title_type = "الحاقی"
|
||||
|
||||
elif caption.startswith("اصلاح ") or caption.startswith("قانون اصلاح "):
|
||||
title_type = "اصلاحی"
|
||||
|
||||
if caption.startswith("الحاق ") or caption.startswith("قانون الحاق ") or caption.startswith("قانون الحاقیه "):
|
||||
return "الحاقی"
|
||||
elif re.match(r"^قانون اضافه.*قانون", caption):
|
||||
return "الحاقی"
|
||||
elif caption.startswith("اصلاح ") or re.match(r"^قانون اصلاح(?:ی)? .*قانون", caption):
|
||||
return "اصلاحی"
|
||||
elif re.match(r"^قانون اصلاحیه.*قانون", caption):
|
||||
return "اصلاحی"
|
||||
elif re.match(r"^قانون تغییر.*قانون", caption):
|
||||
return "اصلاحی"
|
||||
elif caption.startswith("نظر تفسیری ") or caption.startswith("استفساریه ") or caption.startswith("تفسیر ") or caption.startswith("قانون تفسیر ") or caption.startswith("قانون استفساریه "):
|
||||
title_type = "تفسیری"
|
||||
|
||||
return "تفسیری"
|
||||
elif caption.startswith("تصمیم "):
|
||||
title_type = "تصمیم"
|
||||
|
||||
return "تصمیم"
|
||||
elif caption.startswith("نظر "):
|
||||
title_type = "نظر"
|
||||
|
||||
return "نظر"
|
||||
elif caption.startswith("نامه "):
|
||||
title_type = "نامه"
|
||||
|
||||
elif caption.startswith("قانون لغو "):
|
||||
title_type = "لغو"
|
||||
|
||||
return "نامه"
|
||||
elif caption.startswith("قانون لغو ") or caption.startswith("قانون الغای ") or caption.startswith("قانون الغاء "):
|
||||
return "لغو"
|
||||
elif caption.startswith("قانون برنامه "):
|
||||
title_type = "برنامه"
|
||||
|
||||
return "برنامه"
|
||||
elif caption.startswith("قانون بودجه "):
|
||||
title_type = "بودجه"
|
||||
|
||||
return "بودجه"
|
||||
elif caption.startswith("قانون حذف "):
|
||||
title_type = "حذفی"
|
||||
|
||||
return "حذفی"
|
||||
elif re.match(r"^قانون حذف.*قانون", caption):
|
||||
return "حذفی"
|
||||
elif caption.startswith("قانون تمدید "):
|
||||
title_type = "تمدیدی"
|
||||
|
||||
return "تمدیدی"
|
||||
elif re.match(r"^قانون دایمی.*قانون", caption):
|
||||
return "تمدیدی"
|
||||
elif re.match(r"^قانون دائمی.*قانون", caption):
|
||||
return "تمدیدی"
|
||||
elif caption.startswith("قانون شمول "):
|
||||
title_type = "شمولی"
|
||||
|
||||
return "شمولی"
|
||||
elif re.match(r"^قانون شمول.*قانون", caption):
|
||||
return "شمولی"
|
||||
elif re.match(r"^قانون نسخ.*قانون", caption):
|
||||
return "نسخی"
|
||||
elif re.match(r"^قانون متمم.*قانون", caption):
|
||||
return "مربوط"
|
||||
elif re.match(r"^قانون مربوط.*قانون", caption):
|
||||
return "مربوط"
|
||||
elif re.match(r"^قانون تکمیل.*قانون", caption):
|
||||
return "مربوط"
|
||||
elif re.match(r"^قانون راجع.*قانون", caption):
|
||||
return "مربوط"
|
||||
|
||||
elif caption.startswith("قانون موقتی ") or caption.startswith("قانون موقت "):
|
||||
title_type = "موقتی"
|
||||
|
||||
elif caption.__contains__("موافقتنامه") or caption.__contains__("موافقت نامه"):
|
||||
title_type = "موافقتنامه"
|
||||
|
||||
return "موقتی"
|
||||
elif "موافقتنامه" in caption or "موافقت نامه" in caption:
|
||||
return "موافقتنامه"
|
||||
else:
|
||||
title_type = "عادی"
|
||||
|
||||
return title_type
|
||||
|
||||
return "اصلی"
|
||||
Reference in New Issue
Block a user