From ad5bcb1c448b51af3dcb0b5e8ed69730ef67259a Mon Sep 17 00:00:00 2001 From: hsafaei Date: Wed, 23 Apr 2025 16:42:13 +0330 Subject: [PATCH] permission entity tree list --- all_sql_steps.py | 31 ++-- config_base.py | 3 +- elastic_helper.py | 26 +++ import_prev_qanon_info.py | 50 ++++++ import_sysnoym.py | 77 ++++++++ list_LWTopic.json | 1 + r1_LawSection_repair1.py | 369 ++++++++++++++++++++++++++++++++++++++ temp_codes.py | 55 +++++- text_normalizer.py | 82 ++++++++- 9 files changed, 663 insertions(+), 31 deletions(-) create mode 100644 import_prev_qanon_info.py create mode 100644 import_sysnoym.py create mode 100644 list_LWTopic.json create mode 100644 r1_LawSection_repair1.py diff --git a/all_sql_steps.py b/all_sql_steps.py index bc96728..92876b9 100644 --- a/all_sql_steps.py +++ b/all_sql_steps.py @@ -32,18 +32,17 @@ from s11_Tanghih_plan_move import * cursor, cnxn = create_cursor() ## ایجاد فهرست موضوعات قانون -projectid = insertProejct() -insertProjectItems(cursor, projectid) +#projectid = insertProejct() +#insertProjectItems(cursor, projectid) # 2 -import_law_section_to_elastic(cursor) - - -import_opinion_to_elastic(cursor) +#import_law_section_to_elastic(cursor) import_regulation_section_to_elastic(cursor) +import_opinion_to_elastic(cursor) + ### از ابتدا تا اینجا حدودا 24 ساعت کشید @@ -55,22 +54,22 @@ import_regulation_section_update_ref_state(cursor) import_law_reg_qanon_to_elastic(cursor) -## تا اینجا رسید و خطا داد -import_relations_qanon_lwreg(cursor) +# ## تا اینجا رسید و خطا داد +# import_relations_qanon_lwreg(cursor) -## اینجا خطا داد -import_relations_qanon_opinion(cursor) +# ## اینجا خطا داد +# import_relations_qanon_opinion(cursor) -import_lawreg_lwphase_info(cursor) +# import_lawreg_lwphase_info(cursor) cursor.close() cnxn.close() -cursor, cnxn = create_cursor('db4minaei') -#import_tangih_tree_to_list(cursor) -import_tanghih_plan_codes(cursor) +# cursor, cnxn = create_cursor('db4minaei') +# #####import_tangih_tree_to_list(cursor) +# import_tanghih_plan_codes(cursor) -cursor.close() -cnxn.close() +# cursor.close() +# cnxn.close() diff --git a/config_base.py b/config_base.py index 203a9c6..1eac6f2 100644 --- a/config_base.py +++ b/config_base.py @@ -6,7 +6,8 @@ import pyodbc # دریافت شود و به جای توکن زیر جایگزین شود # TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3Mzk3ODc1NTQsImp0aSI6IlpKRnhHUjFPR2p6b2RqWGxoVzJpSzFSeks5VVNwdXE0IiwiaXNzIjpudWxsLCJleHAiOjE3NDEwODc1NTMsImF1ZCI6bnVsbCwiZGF0YSI6eyJpZCI6MSwiZmlyc3RfbmFtZSI6Ilx1MDY0NVx1MDYyZlx1MDZjY1x1MDYzMSBcdTA2NDFcdTA2NDZcdTA2Y2MiLCJsYXN0X25hbWUiOiJcdTA2MzNcdTA2MjdcdTA2NDVcdTA2MjdcdTA2NDZcdTA2NDciLCJlbWFpbCI6ImRldkBnbWFpbC5jb20iLCJ1c2VybmFtZSI6ImRldiIsInVzZXJfbGV2ZWwiOjJ9fQ.orS-RbJkYY2nT6r7WKDfL2Wy2M0rJ9Gh_RpZv5kvVvU' -TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NDM4NTQ0MTEsImp0aSI6IjhDOWErR3BPMGk5U3Blc0ZFT251RDNoM2t3XC82R1BWTiIsImlzcyI6bnVsbCwiZXhwIjoxNzQ1MTU0NDEwLCJhdWQiOm51bGwsImRhdGEiOnsiaWQiOjEsImZpcnN0X25hbWUiOiJcdTA2NDVcdTA2MmZcdTA2Y2NcdTA2MzEgXHUwNjQxXHUwNjQ2XHUwNmNjIiwibGFzdF9uYW1lIjoiXHUwNjMzXHUwNjI3XHUwNjQ1XHUwNjI3XHUwNjQ2XHUwNjQ3IiwiZW1haWwiOiJkZXZAZ21haWwuY29tIiwidXNlcm5hbWUiOiJkZXYiLCJ1c2VyX2xldmVsIjoyfX0.jke3m7QD2pj7E18fBJYjiz9FrYbl6ZxVaYbLt9jfZu0' +# TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NDM4NTQ0MTEsImp0aSI6IjhDOWErR3BPMGk5U3Blc0ZFT251RDNoM2t3XC82R1BWTiIsImlzcyI6bnVsbCwiZXhwIjoxNzQ1MTU0NDEwLCJhdWQiOm51bGwsImRhdGEiOnsiaWQiOjEsImZpcnN0X25hbWUiOiJcdTA2NDVcdTA2MmZcdTA2Y2NcdTA2MzEgXHUwNjQxXHUwNjQ2XHUwNmNjIiwibGFzdF9uYW1lIjoiXHUwNjMzXHUwNjI3XHUwNjQ1XHUwNjI3XHUwNjQ2XHUwNjQ3IiwiZW1haWwiOiJkZXZAZ21haWwuY29tIiwidXNlcm5hbWUiOiJkZXYiLCJ1c2VyX2xldmVsIjoyfX0.jke3m7QD2pj7E18fBJYjiz9FrYbl6ZxVaYbLt9jfZu0' +TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NDQ5MDExMzgsImp0aSI6IldsWnRWa0dxZTUwbHQwc1VRXC82TW1zeUFGcytTdXVwWSIsImlzcyI6bnVsbCwiZXhwIjoxNzQ2MjAxMTM3LCJhdWQiOm51bGwsImRhdGEiOnsiaWQiOjEsImZpcnN0X25hbWUiOiJcdTA2NDVcdTA2MmZcdTA2Y2NcdTA2MzEgXHUwNjQxXHUwNjQ2XHUwNmNjIiwibGFzdF9uYW1lIjoiXHUwNjMzXHUwNjI3XHUwNjQ1XHUwNjI3XHUwNjQ2XHUwNjQ3IiwiZW1haWwiOiJkZXZAZ21haWwuY29tIiwidXNlcm5hbWUiOiJkZXYiLCJ1c2VyX2xldmVsIjoyfX0.EXMgeLkudzt9_94SoYQm09ERf6ES2FIleXgMAPXkygk' ACCEPT = "application/json" HEADERS = {"Authorization": TOKEN, "Accept": ACCEPT} diff --git a/elastic_helper.py b/elastic_helper.py index c0c6c26..df133f5 100644 --- a/elastic_helper.py +++ b/elastic_helper.py @@ -51,6 +51,14 @@ class ElasticHelper(): self.id = "" + def get_doctument(self, index_name, id): + res = self.es.get(index=index_name, id=id) + return res + + def exist_doctument(self, index_name, id): + res = self.es.exists(index=index_name, id=id) + return res + def update_index_doc(self, is_update_state, index_name_o, eid, data): if is_update_state: resp = self.es.update(index=index_name_o, id=eid, doc=data) @@ -220,6 +228,24 @@ class ElasticHelper(): self.createIndex(index_name, app_key, map_name) self.zipFileToElastic(file_path, index_name) + def restorFileToElastic2(self, path_file, index_name, app_key = '', queryDelete = True, map_name='') : + if not os.path.exists(path_file) : + print(' **** error *** path not exist: ', path_file) + return False + + file_path = path_file + if not os.path.exists(file_path ) : + return False + + if queryDelete : + # اگر وجود داشته باشد، از کاربر برای حذفش سوال میکند + if self.deleteIndex(index_name) : + self.createIndex(index_name, app_key, map_name) + self.zipFileToElastic(file_path, index_name) + else : # اگر وجود داشته باشد پرش می کند و کاری نمیکند + self.createIndex(index_name, app_key, map_name) + self.zipFileToElastic(file_path, index_name) + def renameElasticIndex(self, index_name_i, index_name_o, app_key = '', map_name='') : diff --git a/import_prev_qanon_info.py b/import_prev_qanon_info.py new file mode 100644 index 0000000..8cec11b --- /dev/null +++ b/import_prev_qanon_info.py @@ -0,0 +1,50 @@ +import os +from dotenv import load_dotenv +from text_normalizer import TextNormalizer +# from general import * +from general_functions import * +from elastic_helper import ElasticHelper +from create_relation_tags import * +from temp_refactor_gn_dataset import * + +from temp_LawSection_content import * + +# cursor, cnxn = create_cursor() +# import_law_section_to_elastic(cursor) + + +load_dotenv(dotenv_path='config.env') + + +host=os.getenv('HOST_160') +password=os.getenv('HOST_160_PASS') + +print(host) +# print(password) + +path_base_map = "G:/Project2/gateway2_main/repo/_other/" +elastic = ElasticHelper(host, password, "elastic", path_base_map) + + + +def import_prev_qanon_info(elastic, file_excel, index_name_o): + + # خواند اکسل file_excel + + list = [] + for item in list : + # item .... + + eid = 0 ### ?? + data = { + + } + + try: + resp = elastic.update_index_doc(True, index_name_o, eid, data) + except Exception as e: + save_error(id, e) + + +file_excel = '' +import_prev_qanon_info(elastic, file_excel, "mj_qa_section" ) \ No newline at end of file diff --git a/import_sysnoym.py b/import_sysnoym.py new file mode 100644 index 0000000..a78b7f5 --- /dev/null +++ b/import_sysnoym.py @@ -0,0 +1,77 @@ +import os +import re +import random +from dotenv import load_dotenv +from text_normalizer import TextNormalizer +# from general import * +from general_functions import * +from elastic_helper import ElasticHelper +from create_relation_tags import * +from temp_refactor_gn_dataset import * + +from temp_LawSection_content import * + +# cursor, cnxn = create_cursor() +# import_law_section_to_elastic(cursor) + + +load_dotenv(dotenv_path='config.env') + + +host=os.getenv('HOST_160') +password=os.getenv('HOST_160_PASS') + +print(host) +# print(password) + +path_base_map = "G:/Project2/gateway2_main/repo/_other/" +elastic = ElasticHelper(host, password, "elastic", path_base_map) + + + +def import_synonym_virstaran_min(elastic, file_input, index_name_o): + + lines = [] + with open(file_input, 'r', encoding='utf-8') as file: + # نوشتن خطا در فایل + lines = file.readlines() + + row = 0 + for item in lines : + item = item.strip() + if not item : + continue + + + words = [] + for w in item.split(','): + w = re.sub(r"\uFEFF|\u00AD|\u00AC", "\u200C", w) + w = w.strip("\u200C").strip() + words.append(w) + + if len(words) == 0 : + continue + + row = row + 1 + + if ( row % 10 ) == 0 : + print( 'row = ', row, '/', len(lines)) + #eid = 'syn_vr_' + random.randrange(10000) + eid = 'syn_vr_' + str(10000+row) + data = { + 'id' : eid, + "main_type": "synonym", + "ref_key": "virastaran", + 'words' : words + } + + try: + resp = elastic.update_index_doc(False, index_name_o, eid, data) + except Exception as e: + save_error(id, e) + + +elastic.createIndex("gn_synonym", '', "gn_synonym" ) + +file_excel = './data/fa_virastarn_min.txt' +import_synonym_virstaran_min(elastic, file_excel, "gn_synonym" ) \ No newline at end of file diff --git a/list_LWTopic.json b/list_LWTopic.json new file mode 100644 index 0000000..17766d1 --- /dev/null +++ b/list_LWTopic.json @@ -0,0 +1 @@ +{"1": {"id": 8315, "title": "\u0645\u062c\u0645\u0648\u0639\u0647 \u0627\u062f\u0627\u0631\u06cc"}, "2": {"id": 8316, "title": "\u0645\u062c\u0645\u0648\u0639\u0647 \u0627\u0633\u0627\u0633\u06cc \u0627\u062c\u062a\u0645\u0627\u0639\u06cc"}, "3": {"id": 8317, "title": "\u0645\u062c\u0645\u0648\u0639\u0647 \u0645\u0627\u0644\u06cc"}, "4": {"id": 8318, "title": "\u0645\u062c\u0645\u0648\u0639\u0647 \u0627\u0642\u062a\u0635\u0627\u062f\u06cc"}, "5": {"id": 8319, "title": "\u0645\u062c\u0645\u0648\u0639\u0647 \u0641\u0631\u0647\u0646\u06af\u06cc"}, "6": {"id": 8320, "title": "\u0645\u062c\u0645\u0648\u0639\u0647 \u06a9\u06cc\u0641\u0631\u06cc"}, "7": {"id": 8321, "title": "\u0645\u062c\u0645\u0648\u0639\u0647 \u0645\u062f\u0646\u06cc"}, "8": {"id": 8322, "title": "\u0634\u0648\u0631\u0627\u0647\u0627\u06cc \u0645\u0631\u062f\u0645\u06cc"}, "9": {"id": 8323, "title": "\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u06a9\u0634\u0648\u0631\u06cc"}, "10": {"id": 8324, "title": "\u0627\u0645\u0648\u0631 \u0628\u06cc\u0646 \u0627\u0644\u0645\u0644\u0644\u06cc"}, "11": {"id": 8325, "title": "\u0633\u0627\u0632\u0645\u0627\u0646\u0647\u0627\u06cc \u062f\u0648\u0644\u062a\u06cc"}, "12": {"id": 8326, "title": "\u0634\u0647\u0631\u062f\u0627\u0631\u06cc"}, "13": {"id": 8327, "title": "\u0648\u06a9\u0627\u0644\u062a"}, "14": {"id": 8328, "title": "\u062f\u0641\u062a\u0631 \u0627\u0633\u0646\u0627\u062f \u0631\u0633\u0645\u06cc"}, "15": {"id": 8329, "title": "\u06a9\u0627\u0631\u0634\u0646\u0627\u0633\u0627\u0646 \u0631\u0633\u0645\u06cc \u0648 \u0645\u062a\u0631\u062c\u0645\u0627\u0646"}, "16": {"id": 8330, "title": "\u0627\u0637\u0627\u0642\u0647\u0627\u06cc \u0628\u0627\u0632\u0631\u06af\u0627\u0646\u06cc \u0648 \u0635\u0646\u0627\u06cc\u0639 \u0648 \u0645\u0639\u0627\u062f\u0646"}, "17": {"id": 8331, "title": "\u0646\u0638\u0627\u0645 \u067e\u0632\u0634\u06a9\u06cc"}, "18": {"id": 8332, "title": "\u0646\u0638\u0627\u0645 \u0635\u0646\u0641\u06cc"}, "19": {"id": 8333, "title": "\u0646\u0638\u0627\u0645 \u0645\u0647\u0646\u062f\u0633\u06cc \u0633\u0627\u062e\u062a\u0645\u0627\u0646"}, "20": {"id": 8334, "title": "\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0642\u0636\u0627\u062a \u0648 \u062a\u0634\u06a9\u06cc\u0644\u0627\u062a \u062f\u0627\u062f\u06af\u0633\u062a\u0631\u06cc"}, "21": {"id": 8335, "title": "\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0646\u06cc\u0631\u0648\u0647\u0627\u06cc \u0645\u0633\u0644\u062d"}, "22": {"id": 8336, "title": "\u0627\u0633\u062a\u0627\u0646\u062f\u0627\u0631\u0627\u0646 \u0648 \u0641\u0631\u0645\u0627\u0646\u062f\u0627\u0631\u0627\u0646"}, "23": {"id": 8337, "title": "\u0646\u0647\u0627\u062f\u0647\u0627\u06cc \u0627\u0646\u0642\u0644\u0627\u0628 \u0627\u0633\u0644\u0627\u0645\u06cc \u0648 \u0646\u0647\u0627\u062f\u0647\u0627\u06cc \u0639\u0645\u0648\u0645\u06cc \u063a\u06cc\u0631 \u062f\u0648\u0644\u062a\u06cc"}, "24": {"id": 8338, "title": "\u0627\u0633\u0627\u0633\u06cc"}, "25": {"id": 8339, "title": "\u062a\u0627\u0645\u06cc\u0646 \u0627\u062c\u062a\u0645\u0627\u0639\u06cc"}, "26": {"id": 8340, "title": "\u0627\u0646\u062a\u062e\u0627\u0628\u0627\u062a"}, "27": {"id": 8341, "title": "\u0627\u06cc\u062b\u0627\u0631\u06af\u0631\u0627\u0646"}, "28": {"id": 8342, "title": "\u0627\u0645\u0646\u06cc\u062a . \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0648 \u062f\u0641\u0627\u0639 \u0645\u0644\u06cc"}, "29": {"id": 8343, "title": "\u06a9\u0627\u0631"}, "30": {"id": 8344, "title": "\u0628\u0647\u062f\u0627\u0634\u062a \u0648 \u062f\u0631\u0645\u0627\u0646"}, "31": {"id": 8345, "title": "\u062e\u062f\u0645\u062a \u0648\u0638\u06cc\u0641\u0647 \u0639\u0645\u0648\u0645\u06cc"}, "32": {"id": 8346, "title": "\u062d\u0641\u0627\u0638\u062a \u0645\u062d\u06cc\u0637 \u0632\u06cc\u0633\u062a"}, "33": {"id": 8347, "title": "\u0627\u062d\u0632\u0627\u0628 . \u062c\u0645\u0639\u06cc\u062a\u0647\u0627 \u0648 \u0627\u0646\u062c\u0645\u0646\u0647\u0627 (\u0633\u06cc\u0627\u0633\u06cc \u0645\u0630\u0647\u0628\u06cc \u0635\u0646\u0641\u06cc )"}, "34": {"id": 8348, "title": "\u0627\u0645\u0648\u0631 \u0645\u062c\u0644\u0633 \u0634\u0648\u0631\u0627\u06cc \u0627\u0633\u0644\u0627\u0645\u06cc"}, "35": {"id": 8349, "title": "\u0628\u0648\u062f\u062c\u0647"}, "36": {"id": 8350, "title": "\u0645\u0627\u0644\u06cc\u0627\u062a"}, "37": {"id": 8351, "title": "\u0648\u0627\u0645 \u0648\u06a9\u0645\u06a9 \u0628\u0644\u0627\u0639\u0648\u0636"}, "38": {"id": 8352, "title": "\u0645\u0639\u0627\u0645\u0644\u0627\u062a \u0648 \u0627\u0645\u0648\u0627\u0644 \u062f\u0648\u0644\u062a\u06cc"}, "39": {"id": 8353, "title": "\u0645\u062d\u0627\u0633\u0628\u0627\u062a \u0639\u0645\u0648\u0645\u06cc"}, "40": {"id": 8354, "title": "\u067e\u06cc\u0645\u0627\u0646\u06a9\u0627\u0631\u0627\u0646"}, "41": {"id": 8355, "title": "\u0627\u062a\u0648\u0645\u0628\u06cc\u0644\u0647\u0627\u06cc \u062f\u0648\u0644\u062a\u06cc (\u062f\u0631 \u062d\u0627\u0644 \u062d\u0627\u0636\u0631 \u0627\u0632 \u0627\u06cc\u0646 \u06a9\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0646\u0645\u06cc \u0634\u0648\u062f)"}, "42": {"id": 8356, "title": "\u062f\u0631\u0622\u0645\u062f\u0647\u0627\u06cc \u0627\u062e\u062a\u0635\u0627\u0635\u06cc \u062f\u0648\u0644\u062a\u06cc \u0648 \u0639\u0648\u0627\u0631\u0636"}, "43": {"id": 8357, "title": "\u062a\u062c\u0627\u0631\u062a"}, "44": {"id": 8358, "title": "\u0631\u0627\u0647 \u0648 \u062a\u0631\u0627\u0628\u0631\u06cc"}, "45": {"id": 8359, "title": "\u0628\u06cc\u0645\u0647"}, "46": {"id": 8360, "title": "\u0635\u0646\u0627\u06cc\u0639"}, "47": {"id": 8361, "title": "\u0628\u0631\u0646\u0627\u0645\u0647 \u0647\u0627\u06cc \u0639\u0645\u0631\u0627\u0646\u06cc"}, "48": {"id": 8362, "title": "\u0645\u0639\u0627\u062f\u0646"}, "49": {"id": 8363, "title": "\u0622\u0628 \u0648 \u0646\u06cc\u0631\u0648"}, "50": {"id": 8364, "title": "\u0646\u0641\u062a \u0648 \u06af\u0627\u0632"}, "51": {"id": 8365, "title": "\u0628\u0627\u0646\u06a9\u06cc \u0648 \u067e\u0648\u0644\u06cc"}, "52": {"id": 8366, "title": "\u0627\u0645\u0648\u0631 \u06af\u0645\u0631\u06a9\u06cc"}, "53": {"id": 8367, "title": "\u067e\u0633\u062a \u0648 \u062a\u0644\u06af\u0631\u0627\u0641 \u0648\u062a\u0644\u0641\u0646"}, "54": {"id": 8368, "title": "\u06a9\u0634\u0627\u0648\u0631\u0632\u06cc \u0648 \u0631\u0648\u0633\u062a\u0627\u06cc\u06cc"}, "55": {"id": 8369, "title": "\u062c\u0646\u06af\u0644\u0647\u0627 \u0648 \u0645\u0631\u0627\u062a\u0639"}, "56": {"id": 8370, "title": "\u0634\u06a9\u0627\u0631 \u0648 \u0635\u06cc\u062f \u0648\u0634\u06cc\u0644\u0627\u062a"}, "57": {"id": 8371, "title": "\u062f\u0631\u06cc\u0627\u06cc\u06cc"}, "58": {"id": 8372, "title": "\u0647\u0648\u0627\u067e\u06cc\u0645\u0627\u06cc\u06cc"}, "59": {"id": 8373, "title": "\u0631\u0627\u0647 \u0622\u0647\u0646"}, "60": {"id": 8374, "title": "\u0628\u0648\u0631\u0633 \u0627\u0648\u0631\u0627\u0642 \u0628\u0647\u0627\u062f\u0627\u0631 \u0648 \u0627\u0633\u0646\u0627\u062f \u062e\u0632\u0627\u0646\u0647"}, "61": {"id": 8375, "title": "\u0627\u0633\u0646\u0627\u062f \u062e\u0632\u0627\u0646\u0647 (\u062f\u0631 \u062d\u0627\u0644 \u062d\u0627\u0636\u0631 \u0627\u0632 \u0627\u06cc\u0646 \u06a9\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0646\u0645\u06cc \u0634\u0648\u062f - \u062a\u0639\u0631\u06cc\u0641 \u062f\u0631 \u06a9\u062f 418)"}, "62": {"id": 8376, "title": "\u062b\u0628\u062a \u0634\u0631\u06a9\u062a\u0647\u0627 \u0648 \u0639\u0644\u0627\u06cc\u0645 \u0648\u0627\u062e\u062a\u0631\u0627\u0639\u0627\u062a"}, "63": {"id": 8377, "title": "\u0648\u0627\u0631\u062f\u0627\u062a \u0648 \u0635\u0627\u062f\u0631\u0627\u062a"}, "64": {"id": 8378, "title": "\u0627\u0645\u0648\u0631 \u062a\u0639\u0627\u0648\u0646\u06cc"}, "65": {"id": 8379, "title": "\u062f\u062e\u0627\u0646\u06cc\u0627\u062a"}, "66": {"id": 8380, "title": "\u062f\u0627\u0645 \u0648 \u0637\u06cc\u0648\u0631"}, "67": {"id": 8381, "title": "\u0633\u0631\u0645\u0627\u06cc\u0647 \u06af\u0630\u0627\u0631\u06cc"}, "68": {"id": 8382, "title": "\u0622\u0645\u0627\u0631 \u0648\u0633\u0631\u0634\u0645\u0627\u0631\u06cc"}, "69": {"id": 8383, "title": "\u0647\u0648\u0627\u0634\u0646\u0627\u0633\u06cc"}, "70": {"id": 8384, "title": "\u0645\u0646\u0627\u0637\u0642 \u0622\u0632\u0627\u062f \u0648\u06cc\u0698\u0647"}, "71": {"id": 8385, "title": "\u0622\u0645\u0648\u0632\u0634 \u0648 \u067e\u0631\u0648\u0631\u0634"}, "72": {"id": 8386, "title": "\u0622\u0645\u0648\u0632\u0634 \u0639\u0627\u0644\u06cc \u0648 \u062a\u062d\u0642\u06cc\u0642\u0627\u062a"}, "73": {"id": 8387, "title": "\u062d\u0645\u0627\u06cc\u062a \u062d\u0642\u0648\u0642 \u0645\u0648\u0644\u0641\u0627\u0646 .\u0645\u0635\u0646\u0641\u0627\u0646 .\u0647\u0646\u0631\u0645\u0646\u062f\u0627\u0646 \u0648 \u0645\u062e\u062a\u0631\u0639\u06cc\u0646"}, "74": {"id": 8388, "title": "\u0641\u0631\u0647\u0646\u06af \u0648 \u0647\u0646\u0631"}, "75": {"id": 8389, "title": "\u0645\u0637\u0628\u0648\u0639\u0627\u062a \u0648 \u0648\u0633\u0627\u06cc\u0644 \u0627\u0631\u062a\u0628\u0627\u0637 \u062c\u0645\u0639\u06cc"}, "76": {"id": 8390, "title": "\u062c\u0631\u0627\u06cc\u0645 \u0648 \u0645\u062c\u0627\u0632\u0627\u062a\u0647\u0627\u06cc \u0639\u0645\u0648\u0645\u06cc"}, "77": {"id": 8391, "title": "\u0622\u06cc\u06cc\u0646 \u062f\u0627\u062f\u0631\u0633\u06cc \u06a9\u06cc\u0641\u0631\u06cc"}, "78": {"id": 8392, "title": "\u062f\u0627\u062f\u0631\u0633\u06cc \u0648 \u06a9\u06cc\u0641\u0631 \u0627\u0631\u062a\u0634"}, "79": {"id": 8393, "title": "\u062c\u0631\u0627\u06cc\u0645 \u0648 \u0645\u062c\u0627\u0632\u0627\u062a\u0647\u0627\u06cc \u0627\u062f\u0627\u0631\u06cc \u06a9\u0627\u0631\u06a9\u0646\u0627\u0646"}, "80": {"id": 8394, "title": "\u062c\u0631\u0627\u06cc\u0645 \u0648 \u0645\u062c\u0627\u0632\u0627\u062a\u0647\u0627\u06cc \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 \u0645\u0648\u0627\u062f \u0645\u062e\u062f\u0631 \u0648 \u0642\u0627\u0686\u0627\u0642"}, "81": {"id": 8395, "title": "\u062a\u062e\u0644\u0641\u0627\u062a \u0631\u0627\u0647\u0646\u0645\u0627\u06cc\u06cc \u0648 \u0631\u0627\u0646\u0646\u062f\u06af\u06cc"}, "82": {"id": 8396, "title": "\u062c\u0631\u0627\u06cc\u0645 \u0645\u0631\u0628\u0648\u0637\u0628\u0647 \u062f\u0627\u062f\u0633\u0631\u0627\u0647\u0627\u0648 \u062f\u0627\u062f\u06af\u0627\u0647\u0647\u0627\u06cc \u0627\u0646\u0642\u0644\u0627\u0628"}, "83": {"id": 8397, "title": "\u062c\u0631\u0627\u06cc\u0645 \u0648 \u0645\u062c\u0627\u0632\u0627\u062a\u0647\u0627\u06cc \u0648\u06cc\u0698\u0647 \u0631\u0648\u062d\u0627\u0646\u06cc\u062a"}, "84": {"id": 8398, "title": "\u062a\u062e\u0644\u0641\u0627\u062a \u0648 \u0645\u062c\u0627\u0632\u0627\u062a\u0647\u0627\u06cc \u062d\u0631\u0641\u0647 \u0627\u06cc \u0648 \u0635\u0646\u0641\u06cc"}, "85": {"id": 8399, "title": "\u062a\u0639\u0632\u06cc\u0631\u0627\u062a \u062d\u06a9\u0648\u0645\u062a\u06cc"}, "86": {"id": 8400, "title": "\u0645\u062f\u0646\u06cc"}, "87": {"id": 8401, "title": "\u0622\u06cc\u06cc\u0646 \u062f\u0627\u062f\u0631\u0633\u06cc \u0645\u062f\u0646\u06cc"}, "88": {"id": 8402, "title": "\u0627\u0645\u0648\u0631 \u062d\u0633\u0628\u06cc"}, "89": {"id": 8403, "title": "\u062b\u0628\u062a \u0627\u062d\u0648\u0627\u0644"}, "90": {"id": 8404, "title": "\u062b\u0628\u062a \u0627\u0633\u0646\u0627\u062f \u0648 \u0627\u0645\u0644\u0627\u06a9"}, "91": {"id": 8405, "title": "\u0645\u0631\u0627\u062c\u0639 \u0627\u062e\u062a\u0635\u0627\u0635\u06cc \u0631\u0633\u06cc\u062f\u06af\u06cc \u0628\u0647 \u0627\u062e\u062a\u0644\u0627\u0641\u0627\u062a (\u063a\u06cc\u0631 \u0642\u0636\u0627\u06cc\u06cc )"}, "92": {"id": 8406, "title": "\u0631\u0648\u0627\u0628\u0637 \u0645\u0648\u062c\u0631\u0648 \u0645\u0633\u062a\u0627\u062c\u0631"}, "93": {"id": 8407, "title": "\u0627\u062a\u0628\u0627\u0639 \u062e\u0627\u0631\u062c\u0647"}, "94": {"id": 8408, "title": "\u0627\u0648\u0642\u0627\u0641"}, "95": {"id": 8409, "title": "\u06af\u0630\u0631\u0646\u0627\u0645\u0647"}, "96": {"id": 8410, "title": "\u0622\u0645\u0627\u0631 \u0648 \u0633\u0631\u0634\u0645\u0627\u0631\u06cc (\u0628\u062c\u0627\u06cc \u0627\u06cc\u0646 \u06a9\u062f \u0627\u0632 \u06a9\u062f 426 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u0634\u0648\u062f )"}, "97": {"id": 8411, "title": "\u062c\u0644\u0648\u06af\u06cc\u0631\u06cc \u0627\u0632 \u062a\u0635\u0631\u0641 \u0639\u062f\u0648\u0627\u0646\u06cc"}, "98": {"id": 8412, "title": "\u062d\u0645\u0627\u06cc\u062a \u062e\u0627\u0646\u0648\u0627\u062f\u0647"}, "99": {"id": 8413, "title": "\u062a\u0645\u0644\u06a9 \u0622\u067e\u0627\u0631\u062a\u0645\u0627\u0646\u0647\u0627 (\u062f\u0631 \u062d\u0627\u0644 \u062d\u0627\u0636\u0631 \u0627\u0632 \u0627\u06cc\u0646 \u06a9\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0646\u0645\u06cc \u0634\u0648\u062f)"}, "100": {"id": 8414, "title": "\u0645\u0633\u06a9\u0646"}, "101": {"id": 8415, "title": "\u0627\u0631\u0627\u0636\u06cc (\u0634\u0647\u0631\u06cc \u0648 \u06a9\u0634\u0627\u0648\u0631\u0632\u06cc )"}, "102": {"id": 8416, "title": "\u062f\u06cc\u0648\u0627\u0646 \u0639\u062f\u0627\u0644\u062a \u0627\u062f\u0627\u0631\u06cc"}, "103": {"id": 8417, "title": "\u062f\u0627\u0648\u0631\u06cc"}, "104": {"id": 8418, "title": "\u0642\u0631\u0627\u0631\u062f\u0627\u062f\u0647\u0627\u06cc \u062f\u0648\u062c\u0627\u0646\u0628\u0647"}, "105": {"id": 8419, "title": "\u0642\u0631\u0627\u0631\u062f\u0627\u062f\u0647\u0627\u06cc \u0686\u0646\u062f \u062c\u0627\u0646\u0628\u0647 \u063a\u06cc\u0631 \u0645\u0646\u0637\u0642\u0647 \u0627\u06cc"}, "106": {"id": 8420, "title": "\u0642\u0631\u0627\u0631\u062f\u0627\u062f\u0647\u0627\u06cc \u0686\u0646\u062f \u062c\u0627\u0646\u0628\u0647 \u0645\u0646\u0637\u0642\u0647 \u0627\u06cc"}, "107": {"id": 8421, "title": "\u0645\u0639\u0627\u0647\u062f\u0627\u062a \u0648 \u06a9\u0646\u0648\u0627\u0646\u0633\u06cc\u0648\u0646\u0647\u0627"}, "108": {"id": 8422, "title": "\u0633\u0627\u0632\u0645\u0627\u0646\u0647\u0627 \u0648 \u0645\u062c\u0627\u0645\u0639 \u0628\u06cc\u0646 \u0627\u0644\u0645\u0644\u0644\u06cc"}, "109": {"id": 8423, "title": "\u0627\u0645\u0648\u0631 \u0645\u0631\u0632\u06cc"}, "110": {"id": 8424, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0648\u0632\u0627\u0631\u062a \u0622\u0645\u0648\u0632\u0634 \u0648 \u067e\u0631\u0648\u0631\u0634"}, "111": {"id": 8425, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0627\u0637\u0644\u0627\u0639\u0627\u062a"}, "112": {"id": 8426, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0627\u0645\u0648\u0631 \u0627\u0642\u062a\u0635\u0627\u062f\u06cc \u0648 \u062f\u0627\u0631\u0627\u06cc\u06cc"}, "113": {"id": 8427, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0627\u0645\u0648\u0631 \u062e\u0627\u0631\u062c\u0647"}, "114": {"id": 8428, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0628\u0627\u0632\u0631\u06af\u0627\u0646\u06cc"}, "115": {"id": 8429, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0628\u0647\u062f\u0627\u0634\u062a \u062f\u0631\u0645\u0627\u0646 \u0648 \u0622\u0645\u0648\u0632\u0634 \u067e\u0632\u0634\u06a9\u06cc"}, "116": {"id": 8430, "title": "\u0648\u0638\u0627\u06cc\u0641 \u067e\u0633\u062a \u0648 \u062a\u0644\u06af\u0631\u0627\u0641 \u0648 \u062a\u0644\u0641\u0646 - \u0648\u0638\u0627\u06cc\u0641 \u0627\u0631\u062a\u0628\u0627\u0637\u0627\u062a \u0648 \u0641\u0646\u0627\u0648\u0631\u06cc \u0627\u0637\u0644\u0627\u0639\u0627\u062a"}, "117": {"id": 8431, "title": "\u0648\u0638\u0627\u06cc\u0641 \u062a\u0639\u0627\u0648\u0646"}, "118": {"id": 8432, "title": "\u0648\u0638\u0627\u06cc\u0641 \u062c\u0647\u0627\u062f \u0633\u0627\u0632\u0646\u062f\u06af\u06cc (\u0642\u0628\u0644 \u0627\u0632 \u0627\u062f\u063a\u0627\u0645 )"}, "119": {"id": 8433, "title": "\u0648\u0638\u0627\u06cc\u0641 \u062f\u0627\u062f\u06af\u0633\u062a\u0631\u06cc"}, "120": {"id": 8434, "title": "\u0648\u0638\u0627\u06cc\u0641 \u062f\u0641\u0627\u0639 \u0648 \u067e\u0634\u062a\u06cc\u0628\u0627\u0646\u06cc \u0646\u06cc\u0631\u0648\u0647\u0627\u06cc \u0645\u0633\u0644\u062d"}, "121": {"id": 8435, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0631\u0627\u0647 \u0648 \u062a\u0631\u0627\u0628\u0631\u06cc"}, "122": {"id": 8436, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0635\u0646\u0627\u06cc\u0639 (\u0642\u0628\u0644 \u0627\u0632 \u0627\u062f\u063a\u0627\u0645)"}, "123": {"id": 8437, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0641\u0631\u0647\u0646\u06af \u0648 \u0622\u0645\u0648\u0632\u0634 \u0639\u0627\u0644\u06cc"}, "124": {"id": 8438, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0641\u0631\u0647\u0646\u06af \u0648 \u0627\u0631\u0634\u0627\u062f \u0627\u0633\u0644\u0627\u0645\u06cc"}, "125": {"id": 8439, "title": "\u0648\u0638\u0627\u06cc\u0641 \u06a9\u0627\u0631 \u0648 \u0627\u0645\u0648\u0631 \u0627\u062c\u062a\u0645\u0627\u0639\u06cc"}, "126": {"id": 8440, "title": "\u0648\u0638\u0627\u06cc\u0641 \u06a9\u0634\u0627\u0648\u0631\u0632\u06cc (\u0642\u0628\u0644 \u0627\u0632 \u0627\u062f\u063a\u0627\u0645)"}, "127": {"id": 8441, "title": "\u0648\u0638\u0627\u06cc\u0641 \u06a9\u0634\u0648\u0631"}, "128": {"id": 8442, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0645\u0633\u06a9\u0646 \u0648 \u0634\u0647\u0631\u0633\u0627\u0632\u06cc"}, "129": {"id": 8443, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0645\u0639\u0627\u062f\u0646 \u0648 \u0641\u0644\u0632\u0627\u062a (\u0642\u0628\u0644 \u0627\u0632 \u0627\u062f\u063a\u0627\u0645 )"}, "130": {"id": 8444, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0646\u0641\u062a"}, "131": {"id": 8445, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0646\u06cc\u0631\u0648"}, "132": {"id": 8446, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0646\u0647\u0627\u062f \u0631\u06cc\u0627\u0633\u062a \u062c\u0645\u0647\u0648\u0631\u06cc"}, "133": {"id": 8447, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0633\u0627\u0632\u0645\u0627\u0646 \u0627\u0645\u0648\u0631 \u0627\u062f\u0627\u0631\u06cc \u0648 \u0627\u0633\u062a\u062e\u062f\u0627\u0645\u06cc \u06a9\u0634\u0648\u0631(\u0642\u0628\u0644 \u0627\u0632 \u0627\u062f\u063a\u0627\u0645)"}, "134": {"id": 8448, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0633\u0627\u0632\u0645\u0627\u0646 \u0627\u0646\u0631\u0698\u06cc \u0627\u062a\u0645\u06cc"}, "135": {"id": 8449, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0633\u0627\u0632\u0645\u0627\u0646 \u0628\u0631\u0646\u0627\u0645\u0647 \u0648 \u0628\u0648\u062f\u062c\u0647 (\u0642\u0628\u0644 \u0627\u0632 \u0627\u062f\u063a\u0627\u0645)"}, "136": {"id": 8450, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0633\u0627\u0632\u0645\u0627\u0646 \u062a\u0631\u0628\u06cc\u062a \u0628\u062f\u0646\u06cc"}, "137": {"id": 8451, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0633\u0627\u0632\u0645\u0627\u0646 \u062d\u0641\u0627\u0638\u062a \u0645\u062d\u06cc\u0637 \u0632\u06cc\u0633\u062a"}, "138": {"id": 8452, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0633\u0627\u0632\u0645\u0627\u0646 \u0635\u062f\u0627 \u0648 \u0633\u06cc\u0645\u0627"}, "139": {"id": 8453, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0633\u0627\u0632\u0645\u0627\u0646\u0647\u0627\u06cc \u0645\u0646\u0627\u0637\u0642 \u0622\u0632\u0627\u062f \u062a\u062c\u0627\u0631\u06cc _\u0635\u0646\u0639\u062a\u06cc"}, "140": {"id": 8454, "title": "\u0648\u0638\u0627\u06cc\u0641 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0645\u0644\u06cc ( \u06a9\u062f \u062c\u062f\u06cc\u062f \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0645\u0644\u06cc 104/23 \u06af\u0631\u062f\u06cc\u062f )"}, "141": {"id": 8455, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0645\u062c\u0644\u0633 \u0634\u0648\u0631\u0627\u06cc \u0627\u0633\u0644\u0627\u0645\u06cc \u0648 \u0645\u062c\u0645\u0639 \u062a\u0634\u062e\u06cc\u0635 \u0645\u0635\u0644\u062d\u062a \u0646\u0638\u0627\u0645 (\u0639\u0644\u0627\u0648\u0647 \u0628\u0631 \u06a9\u062f 211)"}, "142": {"id": 8456, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0628\u0627\u0646\u06a9\u0647\u0627 (\u0639\u0644\u0627\u0648\u0647 \u0628\u0631 \u06a9\u062f 409)"}, "143": {"id": 8457, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0634\u0648\u0631\u0627\u06cc \u0639\u0627\u0644\u06cc \u0627\u0645\u0646\u06cc\u062a \u0645\u0644\u06cc"}, "144": {"id": 8458, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0647\u06cc\u0627\u062a \u0648\u0632\u06cc\u0631\u0627\u0646 \u0648 \u062f\u0648\u0644\u062a"}, "145": {"id": 8459, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0641\u0631\u0645\u0627\u0646\u062f\u0647\u06cc \u06a9\u0644 \u0642\u0648\u0627"}, "146": {"id": 8460, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0645\u062c\u0644\u0633 \u062e\u0628\u0631\u06af\u0627\u0646"}, "147": {"id": 8461, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0645\u0642\u0627\u0645 \u0645\u0639\u0638\u0645 \u0631\u0647\u0628\u0631\u06cc"}, "148": {"id": 8462, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0633\u0627\u0632\u0645\u0627\u0646 \u0645\u062f\u06cc\u0631\u06cc\u062a \u0648 \u0628\u0631\u0646\u0627\u0645\u0647 \u0631\u06cc\u0632\u06cc"}, "149": {"id": 8463, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0648\u0632\u0627\u0631\u062a \u062c\u0647\u0627\u062f \u06a9\u0634\u0627\u0648\u0631\u0632\u06cc"}, "150": {"id": 8464, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0635\u0646\u0627\u06cc\u0639 \u0648 \u0645\u0639\u0627\u062f\u0646"}, "151": {"id": 8465, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0633\u0627\u0632\u0645\u0627\u0646 \u0645\u06cc\u0631\u0627\u062b \u0641\u0631\u0647\u0646\u06af\u06cc \u0648 \u06af\u0631\u062f\u0634\u06af\u0631\u06cc"}, "152": {"id": 8466, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0648\u0632\u0627\u0631\u062a \u0631\u0641\u0627\u0647 \u0648 \u062a\u0627\u0645\u06cc\u0646 \u0627\u062c\u062a\u0645\u0627\u0639\u06cc"}, "153": {"id": 8467, "title": "\u06a9\u0645\u06cc\u062a\u0647 \u0627\u0645\u062f\u0627\u062f \u0627\u0645\u0627\u0645 \u062e\u0645\u06cc\u0646\u06cc"}, "154": {"id": 8468, "title": "\u0633\u0627\u0632\u0645\u0627\u0646 \u062a\u0628\u0644\u06cc\u063a\u0627\u062a \u0627\u0633\u0644\u0627\u0645\u06cc"}, "155": {"id": 8469, "title": "\u0628\u0646\u06cc\u0627\u062f \u0634\u0647\u06cc\u062f \u0627\u0646\u0642\u0644\u0627\u0628 \u0627\u0633\u0644\u0627\u0645\u06cc - \u0628\u0646\u06cc\u0627\u062f \u0634\u0647\u06cc\u062f \u0648 \u0627\u0645\u0648\u0631 \u0627\u06cc\u062b\u0627\u0631\u06af\u0631\u0627\u0646"}, "156": {"id": 8470, "title": "\u0628\u0646\u06cc\u0627\u062f \u0645\u0633\u062a\u0636\u0639\u0641\u0627\u0646 \u0648 \u062c\u0627\u0646\u0628\u0627\u0632\u0627\u0646 \u0627\u0646\u0642\u0644\u0627\u0628 \u0627\u0633\u0644\u0627\u0645\u06cc"}, "157": {"id": 8471, "title": "\u0628\u0646\u06cc\u0627\u062f 15 \u062e\u0631\u062f\u0627\u062f"}, "158": {"id": 8472, "title": "\u0628\u0646\u06cc\u0627\u062f \u0645\u0633\u06a9\u0646 \u0627\u0646\u0642\u0644\u0627\u0628 \u0627\u0633\u0644\u0627\u0645\u06cc"}, "159": {"id": 8473, "title": "\u0634\u0648\u0631\u0627\u06cc \u0639\u0627\u0644\u06cc \u0627\u0646\u0642\u0644\u0627\u0628 \u0641\u0631\u0647\u0646\u06af\u06cc"}, "160": {"id": 8474, "title": "\u062c\u0645\u0639\u06cc\u062a \u0647\u0644\u0627\u0644 \u0627\u062d\u0645\u0631"}, "161": {"id": 8475, "title": "\u0647\u06cc\u0627\u062a \u0647\u0641\u062a \u0646\u0641\u0631\u0647 \u0648\u0627\u06af\u0630\u0627\u0631\u06cc \u0632\u0645\u06cc\u0646"}, "162": {"id": 8476, "title": "\u0646\u0647\u0636\u062a \u0633\u0648\u0627\u062f \u0622\u0645\u0648\u0632\u06cc"}, "163": {"id": 8477, "title": "\u062f\u0641\u062a\u0631 \u062a\u0628\u0644\u06cc\u063a\u0627\u062a \u0627\u0633\u0644\u0627\u0645\u06cc \u0642\u0645"}, "164": {"id": 8478, "title": "\u0633\u062a\u0627\u062f \u0645\u0631\u06a9\u0632\u06cc \u0628\u0627\u0632\u0633\u0627\u0632\u06cc \u0648 \u0646\u0648\u0633\u0627\u0632\u06cc \u0645\u0646\u0627\u0637\u0642"}, "165": {"id": 8479, "title": "\u062c\u0647\u0627\u062f \u062f\u0627\u0646\u0634\u06af\u0627\u0647\u06cc"}, "166": {"id": 8480, "title": "\u062f\u0627\u0646\u0634\u06af\u0627\u0647 \u0634\u0627\u0647\u062f"}, "167": {"id": 8481, "title": "\u06a9\u0645\u06cc\u062a\u0647 \u0645\u0644\u06cc \u0627\u0644\u0645\u067e\u06cc\u06a9 \u0627\u06cc\u0631\u0627\u0646"}, "168": {"id": 8482, "title": "\u0633\u0627\u0632\u0645\u0627\u0646 \u062a\u0627\u0645\u06cc\u0646 \u0627\u062c\u062a\u0645\u0627\u0639\u06cc"}, "169": {"id": 8483, "title": "\u062d\u0648\u0632\u0647 \u0647\u0627\u06cc \u0639\u0644\u0645\u06cc\u0647 (\u0642\u0645 ...)"}, "170": {"id": 8484, "title": "\u0633\u0627\u0632\u0645\u0627\u0646 \u062f\u0647\u06cc\u0627\u0631\u06cc"}, "171": {"id": 8485, "title": "\u0641\u062f\u0627\u0631\u0627\u0633\u06cc\u0648\u0646\u0647\u0627\u06cc \u0648\u0631\u0632\u0634\u06cc \u0622\u0645\u0627\u062a\u0648\u0631\u06cc"}, "172": {"id": 8486, "title": "\u0634\u0648\u0631\u0627\u06cc \u0647\u0645\u0627\u0647\u0646\u06af\u06cc \u062a\u0628\u0644\u06cc\u063a\u0627\u062a \u0627\u0633\u0644\u0627\u0645\u06cc"}, "173": {"id": 8487, "title": "\u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u062d\u0636\u0631\u062a \u0622\u06cc\u062a \u0627... \u0645\u0631\u0639\u0634\u06cc \u0646\u062c\u0641\u06cc"}, "174": {"id": 8488, "title": "\u0645\u0648\u0633\u0633\u0647 \u062c\u0647\u0627\u062f \u0627\u0633\u062a\u0642\u0644\u0627\u0644"}, "175": {"id": 8489, "title": "\u0645\u0648\u0633\u0633\u0647 \u062c\u0647\u0627\u062f \u062a\u0648\u0633\u0639\u0647"}, "176": {"id": 8490, "title": "\u0645\u0648\u0633\u0633\u0647 \u062c\u0647\u0627\u062f \u0646\u0635\u0631"}, "177": {"id": 8491, "title": "\u0628\u0646\u06cc\u0627\u062f \u0627\u0645\u0648\u0631 \u0628\u06cc\u0645\u0627\u0631\u06cc\u0647\u0627\u06cc \u062e\u0627\u0635"}, "178": {"id": 8492, "title": "\u0647\u06cc\u0627\u062a \u0627\u0645\u0646\u0627\u06cc \u0635\u0631\u0641\u0647 \u062c\u0648\u06cc\u06cc \u0627\u0631\u0632\u06cc \u062f\u0631 \u0645\u0639\u0627\u0644\u062c\u0647 \u0628\u06cc\u0645\u0627\u0631\u0627\u0646"}, "179": {"id": 8493, "title": "\u0628\u0646\u06cc\u0627\u062f \u0641\u0631\u0647\u0646\u06af\u06cc \u0648 \u0647\u0646\u0631\u06cc \u0631\u0648\u062f\u06a9\u06cc"}, "180": {"id": 8494, "title": "\u0646\u0647\u0627\u062f \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0647\u0627\u06cc \u0639\u0645\u0648\u0645\u06cc \u06a9\u0634\u0648\u0631"}, "181": {"id": 8495, "title": "\u0633\u0627\u0632\u0645\u0627\u0646 \u0628\u0648\u0631\u0633"}, "182": {"id": 8496, "title": "\u0633\u0627\u0632\u0645\u0627\u0646 \u062f\u0627\u0646\u0634 \u0622\u0645\u0648\u0632\u06cc \u062c.\u0627.\u0627"}, "183": {"id": 8497, "title": "\u0635\u0646\u062f\u0648\u0642 \u0628\u06cc\u0645\u0647 \u0627\u062c\u062a\u0645\u0627\u0639\u06cc \u06a9\u0634\u0627\u0648\u0631\u0632\u0627\u0646\u060c\u0631\u0648\u0633\u062a\u0627\u06cc\u06cc\u0627\u0646 \u0648 \u0639\u0634\u0627\u06cc\u0631"}, "184": {"id": 8498, "title": "\u062d\u0645\u0627\u06cc\u062a\u0647\u0627\u06cc \u062a\u0627\u0645\u06cc\u0646\u06cc \u06a9\u0627\u0631\u06a9\u0646\u0627\u0646 \u062f\u0648\u0644\u062a"}, "185": {"id": 8499, "title": "\u0627\u062a\u0648\u0645\u0628\u06cc\u0644\u0647\u0627\u06cc \u062f\u0648\u0644\u062a\u06cc"}, "186": {"id": 8500, "title": "\u0639\u0648\u0627\u0631\u0636 \u063a\u06cc\u0631 \u062f\u0648\u0644\u062a\u06cc"}, "187": {"id": 8501, "title": "\u0627\u0631\u0627\u0636\u06cc \u062f\u0648\u0644\u062a\u06cc \u0648 \u0648\u0627\u06af\u0630\u0627\u0631\u06cc \u0622\u0646\u0647\u0627"}, "189": {"id": 8502, "title": "\u0635\u0646\u062f\u0648\u0642 \u062a\u0627\u0645\u06cc\u0646 \u062e\u0633\u0627\u0631\u062a\u0647\u0627\u06cc \u0628\u062f\u0646\u06cc"}, "190": {"id": 8503, "title": "\u0648\u0638\u0627\u06cc\u0641 \u062a\u0639\u0627\u0648\u0646 \u060c \u06a9\u0627\u0631 \u0648 \u0631\u0641\u0627\u0647 \u0627\u062c\u062a\u0645\u0627\u0639\u06cc"}, "191": {"id": 8504, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0635\u0646\u0639\u062a \u060c \u0645\u0639\u062f\u0646 \u0648 \u062a\u062c\u0627\u0631\u062a"}, "192": {"id": 8505, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0648\u0632\u0627\u0631\u062a \u0648\u0631\u0632\u0634 \u0648 \u062c\u0648\u0627\u0646\u0627\u0646"}, "193": {"id": 8506, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0648\u0632\u0627\u0631\u062a \u0631\u0627\u0647 \u0648 \u0634\u0647\u0631\u0633\u0627\u0632\u06cc"}, "194": {"id": 8507, "title": "\u0635\u0646\u062f\u0648\u0642 \u0636\u0645\u0627\u0646\u062a \u0633\u067e\u0631\u062f\u0647 \u0647\u0627"}, "214": {"id": 8508, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0642\u0648\u0647 \u0642\u0636\u0627\u06cc\u06cc\u0647"}, "234": {"id": 8509, "title": "\u0627\u0628\u0632\u0627\u0631\u0647\u0627\u06cc \u062a\u0627\u0645\u06cc\u0646 \u0645\u0627\u0644\u06cc \u063a\u06cc\u0631 \u0628\u0648\u0631\u0633\u06cc(\u0627\u0633\u0646\u0627\u062f \u062e\u0632\u0627\u0646\u0647 \u0648 \u0627\u0648\u0631\u0627\u0642 \u0645\u0634\u0627\u0631\u06a9\u062a \u062f\u0648\u0644\u062a\u06cc)"}, "235": {"id": 8510, "title": "\u0627\u0645\u0648\u0631 \u0632\u0646\u0627\u0646"}, "255": {"id": 8511, "title": "\u062a\u062d\u0648\u0644\u0627\u062a \u0645\u0631\u0627\u062c\u0639 \u0648\u0636\u0639"}, "256": {"id": 8512, "title": "\u0646\u0641\u062a"}, "257": {"id": 8513, "title": "\u06af\u0627\u0632"}, "258": {"id": 8514, "title": "\u067e\u062a\u0631\u0648\u0634\u06cc\u0645\u06cc"}, "276": {"id": 8515, "title": "\u0622\u0628"}, "277": {"id": 8516, "title": "\u0628\u0631\u0642"}, "278": {"id": 8517, "title": "\u0627\u0646\u0631\u0698\u06cc \u0647\u0633\u062a\u0647 \u0627\u06cc"}, "279": {"id": 8518, "title": "\u0633\u0627\u06cc\u0631 \u0627\u0646\u0631\u0698\u06cc \u0647\u0627"}, "316": {"id": 8519, "title": "\u0648\u0631\u0632\u0634"}, "349": {"id": 8520, "title": "\u0627\u0645\u0648\u0631 \u06a9\u0634\u0627\u0648\u0631\u0632\u06cc"}, "350": {"id": 8521, "title": "\u0627\u0645\u0648\u0631 \u0631\u0648\u0633\u062a\u0627\u0647\u0627"}, "351": {"id": 8522, "title": "\u0627\u0645\u0648\u0631 \u0639\u0634\u0627\u06cc\u0631"}, "352": {"id": 8523, "title": "\u0635\u0646\u0627\u06cc\u0639 \u0631\u0648\u0633\u062a\u0627\u06cc\u06cc"}, "353": {"id": 8524, "title": "\u0635\u0646\u0627\u06cc\u0639"}, "354": {"id": 8525, "title": "\u0635\u0646\u0627\u06cc\u0639 \u062f\u0633\u062a\u06cc"}, "355": {"id": 8526, "title": "\u0635\u0646\u0627\u06cc\u0639 \u0631\u0648\u0633\u062a\u0627\u06cc\u06cc"}, "356": {"id": 8527, "title": "\u0635\u0646\u0627\u06cc\u0639 \u06a9\u0648\u0686\u06a9"}, "357": {"id": 8528, "title": "\u0634\u0647\u0631\u06a9\u0647\u0627\u06cc \u0635\u0646\u0639\u062a\u06cc"}, "358": {"id": 8529, "title": "\u0646\u0648\u0627\u062d\u06cc \u0635\u0646\u0639\u062a\u06cc"}, "359": {"id": 8530, "title": "\u0627\u0633\u062a\u0627\u0646\u062f\u0627\u0631\u062f"}, "360": {"id": 8531, "title": "\u0627\u0645\u0648\u0631 \u0641\u0631\u0647\u0646\u06af\u06cc"}, "361": {"id": 8532, "title": "\u0627\u0645\u0648\u0631 \u0647\u0646\u0631\u06cc"}, "362": {"id": 8533, "title": "\u0645\u06cc\u0631\u0627\u062b \u0641\u0631\u0647\u0646\u06af\u06cc"}, "363": {"id": 8534, "title": "\u0627\u0639\u0637\u0627\u06cc \u0646\u0634\u0627\u0646 \u0647\u0627\u06cc \u062f\u0648\u0644\u062a\u06cc"}, "364": {"id": 8535, "title": "\u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0647\u0627"}, "368": {"id": 8536, "title": "\u0645\u0637\u0628\u0648\u0639\u0627\u062a \u0648 \u0646\u0634\u0631\u06cc\u0627\u062a"}, "369": {"id": 8537, "title": "\u062e\u0628\u0631\u06af\u0632\u0627\u0631\u06cc \u0647\u0627"}, "370": {"id": 8538, "title": "\u0635\u062f\u0627 \u0648 \u0633\u06cc\u0645\u0627 \u0648 \u062a\u062c\u0647\u06cc\u0632\u0627\u062a \u0645\u062e\u0627\u0628\u0631\u0627\u062a\u06cc \u0645\u0631\u0628\u0648\u0637"}, "371": {"id": 8539, "title": "\u0627\u06cc\u0646\u062a\u0631\u0646\u062a \u0648 \u0641\u0636\u0627\u06cc \u0645\u062c\u0627\u0632\u06cc"}, "372": {"id": 8540, "title": "\u0622\u0645\u0648\u0632\u0634 \u0639\u0627\u0644\u06cc"}, "373": {"id": 8541, "title": "\u062a\u062d\u0642\u06cc\u0642\u0627\u062a"}, "374": {"id": 8542, "title": "\u0646\u062e\u0628\u06af\u0627\u0646 \u0648 \u062f\u0627\u0646\u0634\u0645\u0646\u062f\u0627\u0646"}, "375": {"id": 8543, "title": "\u0634\u0631\u06a9\u062a\u0647\u0627\u06cc \u062f\u0627\u0646\u0634 \u0628\u0646\u06cc\u0627\u0646 \u0648 \u067e\u0627\u0631\u06a9\u0647\u0627\u06cc \u0639\u0644\u0645 \u0648 \u0641\u0646\u0627\u0648\u0631\u06cc"}, "376": {"id": 8544, "title": "\u062a\u0642\u0633\u06cc\u0645\u0627\u062a \u06a9\u0634\u0648\u0631\u06cc"}, "377": {"id": 8545, "title": "\u0627\u0633\u062a\u0627\u0646\u062f\u0627\u0631\u0627\u0646"}, "378": {"id": 8546, "title": "\u0641\u0631\u0645\u0627\u0646\u062f\u0627\u0631\u0627\u0646"}, "379": {"id": 8547, "title": "\u0628\u062e\u0634\u062f\u0627\u0631\u0627\u0646"}, "380": {"id": 8548, "title": "\u062f\u0647\u06cc\u0627\u0631\u0627\u0646"}, "381": {"id": 8549, "title": "\u06af\u0631\u062f\u0634\u06af\u0631\u06cc"}, "382": {"id": 8550, "title": "\u0641\u0631\u0647\u0646\u06af\u0633\u062a\u0627\u0646 \u0647\u0627"}, "385": {"id": 8551, "title": "\u06a9\u0633\u0628 \u0648 \u06a9\u0627\u0631"}} \ No newline at end of file diff --git a/r1_LawSection_repair1.py b/r1_LawSection_repair1.py new file mode 100644 index 0000000..a5429b9 --- /dev/null +++ b/r1_LawSection_repair1.py @@ -0,0 +1,369 @@ +import os +from dotenv import load_dotenv +import json +import requests +from config_base import * +import pyodbc +import requests +from bs4 import BeautifulSoup +from html import escape +import json +from decimal import Decimal +import datetime +import time +from config_base import * +from general_functions import * +from text_normalizer import TextNormalizer +from elastic_helper import ElasticHelper + +##-------------------------------- +# بخاطر خطایی که در تبدیل داده به الاستیک برای مواردی که حرف کشیده به جای خط تیر استفاده شده بود، ایجاد شد +# و این داده به مجلس ارسال شد و کارمندان مجلس هم در داده قانون تغییراتی ایجاد کردند +# لازم شد داده مجلس گرفته شود و اصلاح با احتیاط انجام شود تا تغییرات مجلس نیز حفظ شود +# طبیعتا دیگر نیاز به اجرای این برنامه نخواهد بود +##------------------------------------ + +# cursor, cnxn = create_cursor() + +def extract_all_effecteds(elastic, index_name, body={}): + try: + list = elastic.es_iterate_all_documents(index_name, body) + except Exception as e: + save_error(0, e) + count = 0 + text_normal = TextNormalizer() + result = {} + + for mentry in list: + entry = mentry["source"] + id = entry.get("id", "") + effects = entry.get("effects", []) + for effect in effects : + to_section_id = effect["to_section_id"] + effect_type = effect["effect_type"] + result[to_section_id] = effect_type + return result + + +def repair_law_section_text(cursor, elastic, index_name, dict_changed, file_log) : + + query = ''' + select + s.ID as sectionId + ,isnull(s.SECTIONTEXT,'') as sectionText -- متن ماده یا تبصره + from lwSection s + left join lwLaw l on s.F_LWLAWID = l.ID + where l.ISLAW = 1 + order by s.F_LWLAWID,textOrder + ''' + + cursor.execute(query) + text_normal = TextNormalizer() + + total_count = 0 + bulk_data = [] + + t1= datetime.datetime.now() + print(t1) + + file = open(file_log, 'a+', encoding='utf8') + i = 0 + while 1: + # print(i) + i=i+1 + row = cursor.fetchone() + if not row: + break + + # if i > 1000: + # break + # print(row.sectionId) + + try: + soup = BeautifulSoup(row.sectionText, "html.parser") + text = soup.get_text("\n", strip=True) + # text = removeHtmlNoTableTag(row.sectionText) # خطا داره + except Exception as e: + text = row.sectionText + + + text = text_normal.normalize_qanon(text) + text2 = text_normal.normalize_qanon(text,True) + + # در این صورت مشکل خطای حذف خط تیره کشیده در این متن نبوده و نیازه به بروز رسانی متن نیست + if len(text) == len(text2) : + if text != text2 : + print(' ??????????> changed content : ', eid, "\ntext:", text , "\ntext2:", text2) + continue + + content_len = text.__len__() + + eid='qs'+ str(row.sectionId) + + if eid in dict_changed : + print( ' ------------------> chenged effected : ', dict_changed[eid]) + file.write(' ------------------> chenged effected : '+ dict_changed[eid] + '\n') + if dict_changed[eid] == 'اصلاحی' or dict_changed[eid] == 'جایگزین': + continue + + #word_len = len(split_words(text)) + + data={ + '_id':eid, + '_source' : { + 'content': text, + 'content_len': content_len, + } + } + + item = {} + try: + item = elastic.get_doctument(index_name, eid) + # در اینصورت محتوای ماده توسط مجلس تغییر یافته است + text_m = text_normal.normalize_qanon(item['_source']['content'], True).strip().replace(' ', '') + text_m2 = text_normal.normalize_qanon(text, True).strip().replace(' ', '') + if text_m != text_m2 : + print(' ==========> changed content : ', eid, "\ntext:", text_m , "\ntext:", text_m2) + file.write(' ==========> changed content : '+ eid + '\n') + continue + + except Exception as e: + # print(type(e).__name__) + continue + + # _source = item['_source'] + # if 'ref_state' in _source : + # for ref in _source['ref_state'] : + + + if len(bulk_data) >= 200: + total_count += len(bulk_data) + print('=' * 5, 'law_section ===', ', total='+str(total_count) , str(i)+ ', id=' + eid) + elastic.updateBulkList(bulk_data, index_name) + bulk_data = [] + + bulk_data.append(data) + + + + if len(bulk_data) > 0: + total_count += len(bulk_data) + print('=' * 5, 'law_section ===', ', total='+str(total_count) , str(i)+ ', id=' + eid ) + elastic.updateBulkList(bulk_data, index_name) + + file.close() + print('end success import_law_section_to_elastic') + t2= datetime.datetime.now() + print(t2-t1) + +def repair_law_section_ref_state(cursor, elastic, index_name, dict_changed, file_log) : + + query = ''' + SELECT + gl1.ID as id, + gl4.APPROVEDATE as effect_Date, + gl3.[SECTIONTEXT] as effect_text, + gl3.FULLPATH as effect_section_title, + ls2.SECTIONTEXT as effect_prev_text, + gl4.CAPTION as effect_qanon, + gl1.F_LWLAWID_EFFECTIVE as effect_qanon_id, + gl1.[F_LWSECTIONID_EFFECTIVE] as effect_section_id, + gl1.[F_LWSECTIONID_EFFECTED] as sectionId, + gl2.[SECTIONTEXT], + ls1.CAPTION as effect_section_type, + gl1.DESCRIPTION as description, + gl1.ISIMPLICIT -- تاثیر ضمنی + FROM [Qavanin].[dbo].[lwSectionChange] gl1 + left join [lwLawSectionStatus] ls1 on ls1.ID=gl1.[F_CMBASETABLEID_SECTIONSTATUS] + left join lwSection gl2 on gl2.ID=gl1.[F_LWSECTIONID_EFFECTED] + left join lwSection gl3 on gl3.ID=gl1.[F_LWSECTIONID_EFFECTIVE] + left join lwLaw gl4 on gl1.F_LWLAWID_EFFECTIVE=gl4.ID + left join lwSectionLog ls2 on ls2.ID=gl1.[F_LWSECTIONLOGID_EFFECTED] + + where + gl4.ISLAW = 1 + and gl1.[F_LWSECTIONID_EFFECTED] is not null + + order by gl1.[F_LWSECTIONID_EFFECTED], gl4.APPROVEDATE + + ''' + + cursor.execute(query) + text_normal = TextNormalizer() + + total_count = 0 + bulk_data = [] + previd = '' + prev_effect_type = '' + prev_efect_section_id = '' + ref_state_array = [] + + + t1= datetime.datetime.now() + print(t1) + + file = open(file_log, 'a+', encoding='utf8') + i = 0 + while 1: + # print(i) + i=i+1 + row = cursor.fetchone() + if not row: + break + + # if i > 3: + # break + # print(row.sectionId) + + eid='qs'+ str(row.sectionId) + # lawId='qq'+ str(row.lawId) + + if previd == '': + previd = eid + + + if eid in dict_changed : + print( ' ------------------> chenged effected : ', eid, ' : ', dict_changed[eid]) + file.write(' ------------------> chenged effected : '+ eid+ ' : ' + dict_changed[eid] + '\n') + if dict_changed[eid] == 'اصلاحی' or dict_changed[eid] == 'جایگزین': + continue + + + effect_type = '' + if row.effect_section_type == 'معتبر' : + effect_type = '' + elif row.effect_section_type == 'ساختار الحاقي' or row.effect_section_type == 'ساختار الحاقي مكرر' : + effect_type = 'الحاقی' + elif row.effect_section_type == 'اصلاحي' or row.effect_section_type == 'نامه اصلاحي': + effect_type = 'اصلاحی' + elif row.effect_section_type == 'منسوخه' : + effect_type = 'نسخی' + elif row.effect_section_type == 'احياء' or row.effect_section_type == 'تنفيذ' or row.effect_section_type == 'تمديد': + effect_type = 'تمدیدی' + elif row.effect_section_type == 'تفسير' : + effect_type = 'تفسیری' + elif row.effect_section_type == 'ساختار جايگزين' or row.effect_section_type == 'جايگزين شده': + effect_type = 'جایگزین' + elif row.effect_section_type == 'آزمايشي' : + effect_type = '' + elif row.effect_section_type == 'موقت' : + effect_type = '' + elif row.effect_section_type == 'موقوف الاجراء' : + effect_type = '' + elif row.effect_section_type == 'بااجرامنتفي مي شود' : + effect_type = '' + + if row.ISIMPLICIT : + effect_type += ' ضمنی' + + # if i == 1 : # اولین بار + # prev_effect_type = effect_type + + ref_state = {} + if row.effect_qanon_id : + efect_section_id='qs'+ str(row.effect_section_id) + efect_qanon_id= 'qq'+ str(row.effect_qanon_id) + + if prev_efect_section_id == '' : + prev_efect_section_id = efect_section_id + + ref_state = { + "id" : row.id, + "qanon_id": efect_qanon_id, + "qanon_title" : text_normal.normalize_qanon(row.effect_qanon), + "qanon_date": row.effect_Date, + "section_id": efect_section_id, + "section_title": normalYehKe(row.effect_section_title), + "ref_key": "qavanin", + "effect_type" : effect_type, + "new_text" : text_normal.normalize_qanon(row.effect_text), + "prev_text" : text_normal.normalize_qanon(row.effect_prev_text), + "description" : text_normal.normalize_qanon(row.description) + } + + + if previd == eid : + # موارد کاملا تکراری افزوده نشود + if efect_section_id != prev_efect_section_id or prev_effect_type != effect_type: + ref_state_array.append(ref_state) + prev_efect_section_id = efect_section_id + prev_effect_type = effect_type + ref_state={} + continue + + + data={ + '_id':previd, + '_source' : { + 'ref_state' : ref_state_array + } + } + + + bulk_data.append(data) + + ref_state_array = [] + previd = eid + prev_efect_section_id = efect_section_id + prev_effect_type = effect_type + ref_state_array.append(ref_state) + + if len(bulk_data) >= 100: + total_count += len(bulk_data) + print('=' * 5, 'law_section ===', ', total='+str(total_count) , str(i)+ ', id=' + eid) + elastic.updateBulkList(bulk_data, index_name) + bulk_data = [] + + + + + if ref_state_array.__len__() > 0 : + data={ + '_id':previd, + '_source' : { + 'ref_state' : ref_state_array + } + } + bulk_data.append(data) + # print(bulk_data) + + if len(bulk_data) > 0: + total_count += len(bulk_data) + print('=' * 5, 'law_section ===', ', total='+str(total_count) , str(i)+ ', id=' + eid) + elastic.updateBulkList(bulk_data, index_name) + bulk_data = [] + + print('end success import_law_section_update_ref_state') + t2= datetime.datetime.now() + print(t2-t1) + + +load_dotenv(dotenv_path='config.env') + +host=os.getenv('HOST_160') +password=os.getenv('HOST_160_PASS') + +path_base_map = "G:/Project2/gateway2_main/repo/_other/" +elastic = ElasticHelper(host, password, "elastic", path_base_map) + +cursor, cnxn = create_cursor() + + +body={ + "query": { + "exists": {"field": "effects"} + } +} +dict_effected_sections = extract_all_effecteds(elastic, "mj_df_qanon", body) +# print(dict_effected_sections) + +# try: +# item = elastic.get_doctument("mj_qa_section", "3223423") +# except Exception as e: +# print(e) +# print(type(e).__name__) +# print(str(e)) + +#repair_law_section_text(cursor, elastic, "mj_qa_section", dict_effected_sections, "./output/log_r1.txt") + +repair_law_section_ref_state(cursor, elastic, "mj_qa_section", dict_effected_sections, "./output/log_r2.txt") \ No newline at end of file diff --git a/temp_codes.py b/temp_codes.py index ea9bee0..b572f2b 100644 --- a/temp_codes.py +++ b/temp_codes.py @@ -16,16 +16,16 @@ from temp_LawSection_content import * load_dotenv(dotenv_path='config.env') -# host=os.getenv('HOST_160') -# password=os.getenv('HOST_160_PASS') +host=os.getenv('HOST_160') +password=os.getenv('HOST_160_PASS') # host=os.getenv('HOST_112') # password=os.getenv('HOST_112_PASS') -host=os.getenv('HOST_60') -password=os.getenv('HOST_60_PASS') +# host=os.getenv('HOST_60') +# password=os.getenv('HOST_60_PASS') # host=os.getenv('HOST_161') # password=os.getenv('HOST_161_PASS') @@ -40,6 +40,9 @@ print(host) path_base_map = "G:/Project2/gateway2_main/repo/_other/" elastic = ElasticHelper(host, password, "elastic", path_base_map) + +#elastic.backupIndexToZipfile("G:/Project2/111", "mj_qa_section") + #------------------------------------------------------- ## # elastic.backupIndexToZipfile("G:/Project2/111", "dh_parag_bge") @@ -51,18 +54,19 @@ elastic = ElasticHelper(host, password, "elastic", path_base_map) #------------------------------------------------------- ## backup from hamfahmi.ir #------------------------------------------------------- -# elastic.backupIndexToZipfile("G:/Project2/111/server3", "gn_bayanat") +#elastic.backupIndexToZipfile("G:/Project2/111/server3", "gn_bayanat") +# elastic.backupIndexToZipfile("G:/Project2/111/server3", "gn_synonym") # elastic.backupIndexToZipfile("G:/Project2/111/server3", "gn_log_search") # elastic.backupIndexToZipfile("G:/Project2/111/server3", "gn_log_change") # elastic.backupIndexToZipfile("G:/Project2/111/server3", "gn_calendar") # elastic.backupIndexToZipfile("G:/Project2/111/server3", "gn_entity") # elastic.backupIndexToZipfile("G:/Project2/111/server3", "gn_setting") # elastic.backupIndexToZipfile("G:/Project2/111/server3", "gn_research") -# elastic.backupIndexToZipfile("G:/Project2/111/server3", "gn_synonym") # elastic.backupIndexToZipfile("G:/Project2/111/server3", "mn_jahat") # elastic.backupIndexToZipfile("G:/Project2/111/server3", "mn_crition") + # elastic.backupIndexToZipfile("G:/Project2/111/server3", "mn_sanad") # elastic.backupIndexToZipfile("G:/Project2/111/server3", "mn_steps") # elastic.backupIndexToZipfile("G:/Project2/111/server3", "mn_nesha") @@ -71,12 +75,45 @@ elastic = ElasticHelper(host, password, "elastic", path_base_map) +#------------------------------------------------------- +## backup from 160 +#------------------------------------------------------- +# path_back = 'G:/Project2/_back/server160/_back_elastic0126/' +# elastic.backupIndexToZipfile(path_back, "gn_log_change") +# elastic.backupIndexToZipfile(path_back, "gn_log_action") +# elastic.backupIndexToZipfile(path_back, "gn_log_search") +# elastic.backupIndexToZipfile(path_back, "gn_dataset") +# elastic.backupIndexToZipfile(path_back, "gn_setting") +# elastic.backupIndexToZipfile(path_back, "gn_bayanat") +# elastic.backupIndexToZipfile(path_back, "gn_entity") +# elastic.backupIndexToZipfile(path_back, "gn_research") +# elastic.backupIndexToZipfile(path_back, "gn_dataset") + + +# elastic.backupIndexToZipfile(path_back, "mj_mashruh") +# elastic.backupIndexToZipfile(path_back, "qanonindex") +# elastic.backupIndexToZipfile(path_back, "mj_qa_section") +# elastic.backupIndexToZipfile(path_back, "mj_qa_opinion") +# elastic.backupIndexToZipfile(path_back, "mj_rg_section") +# elastic.backupIndexToZipfile(path_back, "mj_qa_qanon") +# elastic.backupIndexToZipfile(path_back, "rrk_index") +# elastic.backupIndexToZipfile(path_back, "mj_df_qanon") +# elastic.backupIndexToZipfile(path_back, "mj_qa_qanon_ai") +# elastic.backupIndexToZipfile(path_back, "mj_qa_section_ai") + +# gn_version +# mj_tmp_qanon +# gn_dataset2 +# gn_setting2 + +#------------------------------------------------------- + #------------------------------------------------------- ## # ## کد نمونه بازیابی از فایل -#path_back = 'G:/Project2/111/mj_qa_section.zip' -# elastic.createIndex('mj_qa_section', 'majles', 'mj_qa_section') +path_back = 'G:/Project2/111/mj_qa_section.zip' +elastic.createIndex('mj_qa_section', 'majles', 'mj_qa_section') # elastic.zipFileToElastic(path_back, 'mj_qa_section') #selastic.backupIndexToZipfile("G:/Project2/111", "dh_haditha") @@ -88,7 +125,7 @@ elastic = ElasticHelper(host, password, "elastic", path_base_map) #elastic.restorFileToElastic("G:/Project2/111", "mj_qa_section_ai", 'majles', True, "mj_qa_section") # elastic.restorFileToElastic('G:/Project2/111', 'dh_haditha', 'dhadith', 'dh_haditha' ) -elastic.restorFileToElastic('G:/Project2/111', 'gn_calendar') +elastic.restorFileToElastic2('G:/Project2/111/mj_qa_section_2_majles_repair.zip', 'mj_qa_section', 'majles', False, 'mj_qa_section') body= { diff --git a/text_normalizer.py b/text_normalizer.py index 288db2c..9ec3efc 100644 --- a/text_normalizer.py +++ b/text_normalizer.py @@ -21,7 +21,7 @@ class TextNormalizer: words = re.split(r"[\t\n\r\.\'\"«»\)\(\]\[\{\}\%\#\$\*\<\>\/,;،؛ \-!?:٭؟]+", text) return words - def normalize_qanon(self, text): + def normalize_qanon(self, text, error_state=False): if not text : return "" @@ -34,7 +34,10 @@ class TextNormalizer: text = text.replace("\r", "\n") # یکسان سازی اختلاف حروف کیبوردهای مختلف - کدهای مختلف ولی نمایش یکسان - text = self.replace_alphabets(text) + if error_state : + text = self.replace_alphabets_error(text) + else : + text = self.replace_alphabets(text) # اعداد چسبیده به کلمات را با یک فاصله جدا می کند text = self.word_digit_correction(text) @@ -103,6 +106,71 @@ class TextNormalizer: return text + def replace_alphabets_error(self, text): + if not text : + return "" + + text = re.sub(r"\u200e|\u200f", " ", text) # LTR, RTL + + text = re.sub(r"\u00AD|\u00AC", "\u200C", text) # نیم اسپیس خاص + text = re.sub(r"(\u002C)+", "\u200C", text) # نیم اسپیس تکراری + text = re.sub(r"ﺁ|آ", "آ", text) + text = re.sub(r"ﺎ|ٱ|ﺍ", "ا", text) + text = re.sub(r"ٲ|أ|ﺄ|ﺃ", "أ", text) + text = re.sub(r"ﺈ|ﺇ", "إ", text) + text = re.sub(r"ﺐ|ﺏ|ﺑ|ﺒ", "ب", text) + text = re.sub(r"ﭖ|ﭗ|ﭙ|ﭘ", "پ", text) + text = re.sub(r"ﭡ|ٺ|ٹ|ﭞ|ٿ|ټ|ﺕ|ﺗ|ﺖ|ﺘ", "ت", text) + text = re.sub(r"ﺙ|ﺛ|ﺚ|ﺜ", "ث", text) + text = re.sub(r"ﺝ|ڃ|ﺠ|ﺟ", "ج", text) + text = re.sub(r"ڃ|ﭽ|ﭼ", "چ", text) + text = re.sub(r"ﺢ|ﺤ|څ|ځ|ﺣ", "ح", text) + text = re.sub(r"ﺥ|ﺦ|ﺨ|ﺧ", "خ", text) + text = re.sub(r"ڏ|ډ|ﺪ|ﺩ", "د", text) + text = re.sub(r"ﺫ|ﺬ|ذ", "ذ", text) + text = re.sub(r"ڙ|ڗ|ڒ|ڑ|ڕ|ﺭ|ﺮ", "ر", text) + text = re.sub(r"ﺰ|ﺯ", "ز", text) + text = re.sub(r"ﮊ", "ژ", text) + text = re.sub(r"ݭ|ݜ|ﺱ|ﺲ|ښ|ﺴ|ﺳ", "س", text) + text = re.sub(r"ﺵ|ﺶ|ﺸ|ﺷ", "ش", text) + text = re.sub(r"ﺺ|ﺼ|ﺻ|ﺹ", "ص", text) + text = re.sub(r"ﺽ|ﺾ|ﺿ|ﻀ", "ض", text) + text = re.sub(r"ﻁ|ﻂ|ﻃ|ﻄ", "ط", text) + text = re.sub(r"ﻆ|ﻇ|ﻈ", "ظ", text) + text = re.sub(r"ڠ|ﻉ|ﻊ|ﻋ|ﻌ", "ع", text) + text = re.sub(r"ﻎ|ۼ|ﻍ|ﻐ|ﻏ", "غ", text) + text = re.sub(r"ﻒ|ﻑ|ﻔ|ﻓ", "ف", text) + text = re.sub(r"ﻕ|ڤ|ﻖ|ﻗ|ﻘ", "ق", text) + text = re.sub(r"ڭ|ﻚ|ﮎ|ﻜ|ﮏ|ګ|ﻛ|ﮑ|ﮐ|ڪ|ك", "ک", text) + text = re.sub(r"ﮚ|ﮒ|ﮓ|ﮕ|ﮔ", "گ", text) + text = re.sub(r"ﻝ|ﻞ|ﻠ|ڵ|ﻟ", "ل", text) + text = re.sub(r"ﻵ|ﻶ|ﻷ|ﻸ|ﻹ|ﻺ|ﻻ|ﻼ", "لا", text) + text = re.sub(r"ﻡ|ﻤ|ﻢ|ﻣ", "م", text) + text = re.sub(r"ڼ|ﻦ|ﻥ|ﻨ|ﻧ", "ن", text) + text = re.sub(r"ވ|ﯙ|ۈ|ۋ|ﺆ|ۊ|ۇ|ۏ|ۅ|ۉ|ﻭ|ﻮ|ؤ", "و", text) + text = re.sub(r"ﻬ|ھ|ﻩ|ﻫ|ﻪ|ە|ہ", "ه", text) + text = re.sub(r"ﭛ|ﻯ|ۍ|ﻰ|ﻱ|ﻲ|ں|ﻳ|ﻴ|ﯼ|ې|ﯽ|ﯾ|ﯿ|ێ|ے|ى|ي", "ی", text) + text = re.sub(r"¬", "‌", text) + text = re.sub(r"•|·|●|·|・|∙|。|ⴰ", ".", text) + text = re.sub(r",|٬|٫|‚|،", "،", text) + text = re.sub(r"ʕ", "؟", text) + text = re.sub(r"”|“", "\"", text) + text = re.sub(r"۰|٠", "0", text) + text = re.sub(r"۱|١", "1", text) + text = re.sub(r"۲|٢", "2", text) + text = re.sub(r"۳|٣", "3", text) + text = re.sub(r"۴|٤", "4", text) + text = re.sub(r"۵", "5", text) + text = re.sub(r"۶|٦", "6", text) + text = re.sub(r"۷|٧", "7", text) + text = re.sub(r"۸|٨", "8", text) + text = re.sub(r"۹|٩", "9", text) + text = re.sub(r"²", "2", text) + text = re.sub(r"|ِ|ُ|َ|ٍ|ٌ|ً|", "", text) + + text = re.sub(r"ـ", "", text) # حذف حروف کشیده # این باعث خطای حذف اضافی شد و با خط بعدی جایگزین شد + return text + def replace_alphabets(self, text): if not text : return "" @@ -165,10 +233,14 @@ class TextNormalizer: text = re.sub(r"۹|٩", "9", text) text = re.sub(r"²", "2", text) text = re.sub(r"|ِ|ُ|َ|ٍ|ٌ|ً|", "", text) + + #text = re.sub(r"ـ", "", text) # حذف حروف کشیده # این باعث خطای حذف اضافی شد و با خط بعدی جایگزین شد text = re.sub(r'([\u0600-\u06FF])ـ([\u0600-\u06FF])', r'\1\2', text) # حذف حروف کشیده + text = re.sub(r'([\u0600-\u06FF])ـ', r'\1', text) # حذف حروف کشیده return text + def date_correction(self, text): # فرمت YYYY/MM/DD یا YYYY-MM-DD --> YYYY/MM/DD text = re.sub(r'(\d{4})[\/\-](\d{1,2})[\/\-](\d{1,2})', r'\1/\2/\3', text) @@ -240,7 +312,7 @@ class TextNormalizer: # "trimLine": True # حذف فضای خالی اضافی در ابتدا و انتهای متن # } -normalizer = TextNormalizer() +# normalizer = TextNormalizer() # text = """ # سلام -- ـ ـ خوبی # دادی ییی بی داد @@ -263,7 +335,7 @@ normalizer = TextNormalizer() # تبصره 4 ـ در مواردي كه وراث سهم خود از اموال موضوع بندهاي (2)، (4) و (5) اين ماده را به اشخاص ثالث يا وراث ديگر انتقال دهند، علاوه بر ماليات بر ارث به شرح اين فصل، مشمول ماليات طبق مقررات فصول مربوط خواهند بود. # تبصره 5 ـ حقوق ناشي از عقود اجاره به شرط تمليك با بانكها و ساير نهادهاي مالي و اعتباري، نسبت به عرصه و اعيان املاك بر اساس ارزش معاملاتي در تاريخ ثبت انتقال به نام وراث محاسبه خواهد شد. # """ -# text="سلـام" -# text="46- متون زیر به عنوان تبصره‌ های ( 3 ) و ( 4 ) به ماده (-187-) قانون الحاق می ‌شود:" +# # text="سلـام" +# # text="46- متون زیر به عنوان تبصره‌ های ( 3 ) و ( 4 ) به ماده (-187-) قانون الحاق می ‌شود:" # normalized_text = normalizer.normalize_qanon(text) # print(normalized_text)