diff --git a/app/common/config_base.py b/app/common/config_base.py index 940891e..e7cf5c8 100644 --- a/app/common/config_base.py +++ b/app/common/config_base.py @@ -9,7 +9,8 @@ import pyodbc # TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NDM4NTQ0MTEsImp0aSI6IjhDOWErR3BPMGk5U3Blc0ZFT251RDNoM2t3XC82R1BWTiIsImlzcyI6bnVsbCwiZXhwIjoxNzQ1MTU0NDEwLCJhdWQiOm51bGwsImRhdGEiOnsiaWQiOjEsImZpcnN0X25hbWUiOiJcdTA2NDVcdTA2MmZcdTA2Y2NcdTA2MzEgXHUwNjQxXHUwNjQ2XHUwNmNjIiwibGFzdF9uYW1lIjoiXHUwNjMzXHUwNjI3XHUwNjQ1XHUwNjI3XHUwNjQ2XHUwNjQ3IiwiZW1haWwiOiJkZXZAZ21haWwuY29tIiwidXNlcm5hbWUiOiJkZXYiLCJ1c2VyX2xldmVsIjoyfX0.jke3m7QD2pj7E18fBJYjiz9FrYbl6ZxVaYbLt9jfZu0' # TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NDQ5MDExMzgsImp0aSI6IldsWnRWa0dxZTUwbHQwc1VRXC82TW1zeUFGcytTdXVwWSIsImlzcyI6bnVsbCwiZXhwIjoxNzQ2MjAxMTM3LCJhdWQiOm51bGwsImRhdGEiOnsiaWQiOjEsImZpcnN0X25hbWUiOiJcdTA2NDVcdTA2MmZcdTA2Y2NcdTA2MzEgXHUwNjQxXHUwNjQ2XHUwNmNjIiwibGFzdF9uYW1lIjoiXHUwNjMzXHUwNjI3XHUwNjQ1XHUwNjI3XHUwNjQ2XHUwNjQ3IiwiZW1haWwiOiJkZXZAZ21haWwuY29tIiwidXNlcm5hbWUiOiJkZXYiLCJ1c2VyX2xldmVsIjoyfX0.EXMgeLkudzt9_94SoYQm09ERf6ES2FIleXgMAPXkygk' # TOKEN = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NDY2MDA0NjUsImp0aSI6Im9IRjJiRW81ZzhXZm9UdGdrb1BZWmpTb3Arem84N3llIiwiaXNzIjpudWxsLCJleHAiOjE3NDc5MDA0NjQsImF1ZCI6bnVsbCwiZGF0YSI6eyJpZCI6MiwiZmlyc3RfbmFtZSI6Ilx1MDYyZFx1MDY0NVx1MDZjY1x1MDYyZiIsImxhc3RfbmFtZSI6Ilx1MDYzNVx1MDY0MVx1MDYyN1x1MDZjY1x1MDZjYyIsImVtYWlsIjoic2FmYWVpLmhhbWlkQGdtYWlsLmNvbSIsInVzZXJuYW1lIjoiaHNhZmFlaSIsInVzZXJfbGV2ZWwiOjJ9fQ.rKb7fD7hnszRSK2720hvnTE28AFceBRWZIN1H1fC0sw' -TOKEN='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NDgyNTY3MTYsImp0aSI6IlZWejlWRDFGMUx5UkEyd01EaW5od3M3cTJRRkVqYW9kIiwiaXNzIjpudWxsLCJleHAiOjE3NDk1NTY3MTUsImF1ZCI6bnVsbCwiZGF0YSI6eyJpZCI6MSwiZmlyc3RfbmFtZSI6Ilx1MDY0NVx1MDYyZlx1MDZjY1x1MDYzMSBcdTA2NDFcdTA2NDZcdTA2Y2MiLCJsYXN0X25hbWUiOiJcdTA2MzNcdTA2MjdcdTA2NDVcdTA2MjdcdTA2NDZcdTA2NDciLCJlbWFpbCI6ImRldkBnbWFpbC5jb20iLCJ1c2VybmFtZSI6ImRldiIsInVzZXJfbGV2ZWwiOjJ9fQ.QljFs4f0HFT7S8qrib6q54kMWg7z381v2uqoiSFDfR4' +# TOKEN='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NDgyNTY3MTYsImp0aSI6IlZWejlWRDFGMUx5UkEyd01EaW5od3M3cTJRRkVqYW9kIiwiaXNzIjpudWxsLCJleHAiOjE3NDk1NTY3MTUsImF1ZCI6bnVsbCwiZGF0YSI6eyJpZCI6MSwiZmlyc3RfbmFtZSI6Ilx1MDY0NVx1MDYyZlx1MDZjY1x1MDYzMSBcdTA2NDFcdTA2NDZcdTA2Y2MiLCJsYXN0X25hbWUiOiJcdTA2MzNcdTA2MjdcdTA2NDVcdTA2MjdcdTA2NDZcdTA2NDciLCJlbWFpbCI6ImRldkBnbWFpbC5jb20iLCJ1c2VybmFtZSI6ImRldiIsInVzZXJfbGV2ZWwiOjJ9fQ.QljFs4f0HFT7S8qrib6q54kMWg7z381v2uqoiSFDfR4' +TOKEN='eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NjM0NjM1NDcsImp0aSI6Ik02RmN3VkhlZTJLbTlmZ2ZPbk9pdHgrYVpMc2xoclhrIiwiaXNzIjpudWxsLCJleHAiOjE3NjQ3NjM1NDYsImF1ZCI6bnVsbCwiZGF0YSI6eyJpZCI6MSwiZmlyc3RfbmFtZSI6Ilx1MDY0NVx1MDYyZlx1MDZjY1x1MDYzMSBcdTA2NDFcdTA2NDZcdTA2Y2MiLCJsYXN0X25hbWUiOiJcdTA2MzNcdTA2MjdcdTA2NDVcdTA2MjdcdTA2NDZcdTA2NDciLCJlbWFpbCI6ImRldkBnbWFpbC5jb20iLCJ1c2VybmFtZSI6ImRldiIsInVzZXJfbGV2ZWwiOjJ9fQ.f-J12LHU6a166w0RlMJX4c2uhWwbe_usfeKHpcgZzg8' ACCEPT = "application/json" HEADERS = {"Authorization": TOKEN, "Accept": ACCEPT} diff --git a/app/common/elastic_helper.py b/app/common/elastic_helper.py index 73364cf..4d2ac6d 100644 --- a/app/common/elastic_helper.py +++ b/app/common/elastic_helper.py @@ -253,7 +253,7 @@ class ElasticHelper: path_back, index_name, file_name="", - body={"size": 1000}, + body={}, byzip=True, fields=[], noFields=[], @@ -270,6 +270,8 @@ class ElasticHelper: if body == {}: s_res = self.es.search(index=index_name, scroll="5m", size=1000) else: + if not "size" in body : + body["size"] = 1000 s_res = self.es.search(index=index_name, scroll="5m", body=body) self.total = s_res["hits"]["total"]["value"] if self.total == 0: @@ -651,7 +653,7 @@ class ElasticHelper: # - داده‌ها را به صورت bulk وارد می‌کند # - از helpers.bulk Elasticsearch استفاده می‌کند # -----------------------------end---------------------------- - def importJsonDataToElastic(self, jsonData, index_name, fields=[]): + def importJsonDataToElastic(self, jsonData, index_name, fields=[], streem_state = False): chunk_size = 100000 raise_on_error = False raise_on_exception = False @@ -677,15 +679,29 @@ class ElasticHelper: "_source": source, } ) - helpers.bulk( - self.es, - actions, - chunk_size, - raise_on_error, - raise_on_exception, - stats_only, - yield_ok, - ) + if streem_state : + ### /// برای مواردی که نیاز هست خطا فهمیده شود + for ok, result in helpers.streaming_bulk( + self.es, + actions, + raise_on_error=False, + raise_on_exception=False, + ): + if not ok: + print("Error:", result) + + else : + success, errors = helpers.bulk( + self.es, + actions, + chunk_size, + raise_on_error, + raise_on_exception, + stats_only, + yield_ok, + ) + return success, errors + # ----------------------------start--------------------------- # متد fileToElastic: @@ -758,7 +774,7 @@ class ElasticHelper: print("index:", index_name, "=>", filename) with zObject.open(filename) as file: data = json.loads(file.read()) - self.importJsonDataToElastic(data, index_name, fields) + result = self.importJsonDataToElastic(data, index_name, fields) self.es.indices.refresh(index=index_name) print(self.es.cat.count(index=index_name, format="json")) diff --git a/app/common/general_functions.py b/app/common/general_functions.py index d7ca6d0..1bfb11b 100644 --- a/app/common/general_functions.py +++ b/app/common/general_functions.py @@ -402,15 +402,25 @@ def jdate2timestamp_old(dt): return tst def jdate2timestamp(dt): - ndt = dt.replace("y", "") - ndt = ndt.replace("m", "/") - ndt = ndt.replace("d", "/") - gd = Persian(ndt).gregorian_datetime() + text = dt + if dt.startswith("y") : + # y1404m1d14 + text = dt.replace("y", "") + text = text.replace("m", "/") + text = text.replace("d", "/") + + gd = Persian(text).gregorian_datetime() base = datetime.date(1970, 1, 1) rr = (gd-base).total_seconds() tst = int( round(rr) * 1000) return tst +def jdate2Gregorian(text): + gd = Persian(text).gregorian_datetime() + tst = gd.strftime("%Y-%m-%d") + # tst = d.isoformat() + return tst + def getSortTimestamp(ts_date): @@ -1123,6 +1133,45 @@ def myTimestamp(days=0): #//////////////////////////////////////////////////////////// #//////////////////////////////////////////////////////////// +def is_match_persian_date_format(text): + if text == '0000/00/00' : + return False + + if text == '00/00/00' : + return False + + # items = text.split('/') + + pattern = r'\d{4}/\d{1,2}/\d{1,2}' + if re.match(pattern,text) : + return True + return False + + +def excel_to_json(excel_file, required_columns=None, sheet_name=0): + """ + خواندن یک sheet از فایل اکسل و تبدیل به لیست دیکشنری. + + Args: + sheet_name: نام sheet (رشته) یا شماره آن (عدد). پیش‌فرض: 0 (اولین sheet) + """ + sheet_names = pd.ExcelFile(excel_file).sheet_names + + print("all sheet") + for i, name in enumerate(sheet_names, start=1): + print(f" {i}. {name}") + + df = pd.read_excel(excel_file, sheet_name=sheet_name) + + if required_columns is None: + selected_columns = df.columns.tolist() + else: + missing = [col for col in required_columns if col not in df.columns] + if missing: + raise ValueError(f"ستون‌های مفقوده در sheet '{sheet_name}': {missing}") + selected_columns = required_columns + + return df[selected_columns].to_dict(orient="records") diff --git a/app/import_from_sql/ai_create_index.py b/app/for_ai/ai_create_index.py similarity index 100% rename from app/import_from_sql/ai_create_index.py rename to app/for_ai/ai_create_index.py diff --git a/app/for_ai/codes_import_from_excel.py b/app/for_ai/codes_import_from_excel.py index a86eba1..94b7e64 100644 --- a/app/for_ai/codes_import_from_excel.py +++ b/app/for_ai/codes_import_from_excel.py @@ -557,32 +557,43 @@ def extract_codes_to_json( file_excel, tcode_label, file_json): df = pd.read_excel(file_excel, sheet_name=0) count = 0 rows_list = df.to_dict(orient='records') - total = len(df[0]) - print('total : ', total) - + column_names = df.columns.tolist() print(column_names) + number_base = 0 + total = len(df) + + print('total : ', total) + bulk_data = [] total_update=0 row_number = 0 try: for row in rows_list: - section_title = row[column_names[0]] - # ts_date = row[column_names[1]] - # qanon_title = row[column_names[2]] - code_state = row[column_names[3]] - row_number = row[column_names[4]] - # qanon_id = row[column_names[5]] - section_id = row[column_names[6]] - # state_match = row[column_names[7]] + section_title = "" + section_id = "" + try: + section_title = row[column_names[number_base]] + # ts_date = row[column_names[1]] + # qanon_title = row[column_names[2]] + code_state = row[column_names[number_base+3]] + row_number = row[column_names[number_base+4]] + # qanon_id = row[column_names[5]] + section_id = row[column_names[number_base+6]] + # state_match = row[column_names[7]] + except : + pass section_id_new = 0 # c_name = 'حکم' # بعضی فایلهای اصلاحی، شناسه اینجا ذخیره شده بود # if c_name in column_names : # section_id_new = row[c_name] + if is_nan_or_none_or_empty(section_title) : + continue + if not is_nan_or_none_or_empty(section_id_new) and section_id_new != 0 : section_id = section_id_new @@ -625,7 +636,7 @@ def run_codes_to_elastic_directory(elastic, directory, output, all_codes, update file_name = os.path.basename(file) _name = os.path.splitext(file_name)[0] code_name = _name.split('_')[0] - print('=========================== start code_name ===> ', code_name) + print('=========================== start code_name ===> ', code_name[::-1]) w1 = text_normalizer.split_words(code_name)[0] log_file = output + "/log_r_"+w1+".txt" file_path = os.path.join(directory, file) diff --git a/app/for_ai/llm_excel_codes_import_to_es.py b/app/for_ai/llm_excel_codes_import_to_es.py index 07979e2..45e9da7 100644 --- a/app/for_ai/llm_excel_codes_import_to_es.py +++ b/app/for_ai/llm_excel_codes_import_to_es.py @@ -7,6 +7,7 @@ from collections import defaultdict from dotenv import load_dotenv from app.common.text_normalizer import TextNormalizer from app.common.elastic_helper import ElasticHelper +from app.common.general_functions import excel_to_json import pandas as pd import json from pathlib import Path @@ -31,32 +32,6 @@ from openpyxl import Workbook text_normalizer = TextNormalizer() -def excel_to_json(excel_file, required_columns=None, sheet_name=0): - """ - خواندن یک sheet از فایل اکسل و تبدیل به لیست دیکشنری. - - Args: - sheet_name: نام sheet (رشته) یا شماره آن (عدد). پیش‌فرض: 0 (اولین sheet) - """ - sheet_names = pd.ExcelFile(excel_file).sheet_names - - print("all sheet") - for i, name in enumerate(sheet_names, start=1): - print(f" {i}. {name}") - - df = pd.read_excel(excel_file, sheet_name=sheet_name) - - if required_columns is None: - selected_columns = df.columns.tolist() - else: - missing = [col for col in required_columns if col not in df.columns] - if missing: - raise ValueError(f"ستون‌های مفقوده در sheet '{sheet_name}': {missing}") - selected_columns = required_columns - - return df[selected_columns].to_dict(orient="records") - - def update_history_code(elastic, data, index_name_o, sub_key, label_name, version_key): send_round = 1 diff --git a/app/for_ai/majles_codes_update_steps.py b/app/for_ai/majles_codes_update_1_steps.py similarity index 100% rename from app/for_ai/majles_codes_update_steps.py rename to app/for_ai/majles_codes_update_1_steps.py diff --git a/app/for_ai/majles_codes_update_2_steps.py b/app/for_ai/majles_codes_update_2_steps.py new file mode 100644 index 0000000..e594dbe --- /dev/null +++ b/app/for_ai/majles_codes_update_2_steps.py @@ -0,0 +1,156 @@ +import numbers +import os +from dotenv import load_dotenv +from elasticsearch import Elasticsearch, helpers +import json +import re +import zipfile + +import sys +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))) + +from app.common.elastic_helper import ElasticHelper +from app.common.general_functions import * +from app.common.text_normalizer import TextNormalizer + +from app.for_ai.codes_import_from_excel import run_codes_extract_directory +from app.parvande_qanon.import_qavanin_files_to_elastic import import_excel_before_to_elastic, import_excel_after_to_elastic, import_excel_tasmimat_to_elastic +from app.parvande_qanon.repair_qa_qanon_for_map_new import * + +text_normal = TextNormalizer() + + +load_dotenv(dotenv_path='config.env') + +host=os.getenv('HOST_160') +password=os.getenv('HOST_160_PASS') +# print( "---------------->>>>>>>>>>>>>>>", host ) + +# host=os.getenv('HOST_113') +# password=os.getenv('HOST_113_PASS') + + +print('.... majles_codes_update_steps ......', host) + +path_base_map = "G:/Project2/gateway_php/repo/_other/" +elastic = ElasticHelper(host, password, "elastic", path_base_map) + +#------------------------------------- +#--- مواردی از قانونهای جدید که فیلد زیر را ندارند باید اصلاح شوند +#--- main_type + +# POST mj_qa_qanon/_update_by_query +body= { + "query": { + "bool": { + "must_not": [ + {"exists": {"field": "main_type"}} + ] + } + }, + "script": { + "source": """ + + ctx._source.main_type = 'قانون' + """, + + "lang": "painless" + } +} + +# elastic.updateByQueryIndex("mj_qa_qanon", body) + + +# POST mj_qa_qanon/_update_by_query +body = { + "query": { + "terms": { + "main_type": [ + "اصلی", + "تبعی" + ] + } + } + , + "script": { + "source": """ + + ctx._source.sub_type = ctx._source.main_type; + ctx._source.main_type = 'قانون' + """, + + "lang": "painless" + } +} +# elastic.updateByQueryIndex("mj_qa_qanon", body) + + +#------------------------------------- +#------ استخراج برخی کدهای باقیمانده که اکسل آنها از قبل موجود هست و تولید فایل مناسب برای درج فایل محور در بانک مجلس +#--- +all_codes = [] +with open("./data/codes49.json", "r", encoding="utf8") as f: + codes_1 = json.load(f) + all_codes = codes_1 + +# run_codes_extract_directory( "./data/tcodes/corrected_majles/not_edit2", "./data/tcodes/corrected_majles/not_edit2/result_json", all_codes) + +#------------------------------------- +#----- پشتیبان گیری از داده های جدید داتیک + +# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_rg_section_temp", "mj_rg_section_doctic_14040824") +# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_qa_section_temp", "mj_qa_section_doctic_14040824") +# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_qa_opinion_temp", "mj_qa_opinion_doctic_14040824") +# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_qa_qanon_temp", "mj_qa_qanon_doctic_14040824") + +#------------------------------------- +#----- ترمیم داده های تاریخ ایندکس قبلی +# -- qaqanon +# elastic.backupIndexToZipfile("G:/Project2/111", "mj_qa_qanon") + +# file_path = 'G:/Project2/111/mj_qa_qanon.zip' +file_path = 'G:/Project2/160_dotic/mj_qa_qanon_112.zip' +index_name = "mj_qa_qanon" + +elastic.createIndex( 'mj_qa_qanon', 'majles', 'mj_qa_qanon') +# restore_correct_data_to_elastic(elastic, file_path, index_name ) +elastic.restorFileToElastic2('G:/Project2/160_dotic/mj_qa_qanon_112.zip', 'mj_qa_qanon', 'majles', False, 'mj_qa_qanon') + +#------------------------------------- +#------------------------------------- + +#-- حذف مقرره های قبلی +body = { + "query": { + "term": { + "main_type": { + "value": "مقرره" + } + } + } +} +# elastic.deleteByQueryIndex("mj_qa_qanon", body) +# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_qa_qanon", "mj_qa_qanon_base") + +#------------------------------------- +#----- موقتی برای تستهای از این مرحله به بعد یه پشتیبان تمیز باشه ... +# elastic.createIndex( 'mj_qa_qanon', 'majles', 'mj_qa_qanon') +# elastic.restorFileToElastic2('G:/Project2/160_dotic/mj_qa_qanon_base.zip', 'mj_qa_qanon', 'majles', False, 'mj_qa_qanon') + + +# import_data_new_qaqanon(elastic, "G:/Project2/160_dotic/mj_qa_qanon_doctic_14040824.zip") + +#------------------------------------- +#------------------------------------- +#------------------------------------- + +# file_excel = "G:\Project2\NLP\dataParsers\data\qavanin_files\qavanin_output4.xlsx" +# import_excel_before_to_elastic(elastic, file_excel, "mj_qa_qanon") + + +# file_excel = "G:\Project2\NLP\dataParsers\data\qavanin_files\qavanin_output4.xlsx" +# import_excel_after_to_elastic(elastic, file_excel, "mj_qa_qanon") + + +# file_excel = "G:\Project2\NLP\dataParsers\data\qavanin_files\فهرست تصمیمات قانونی.elsx" +# import_excel_tasmimat_to_elastic(elastic, file_excel, "mj_qa_qanon") diff --git a/app/temp_refactor_gn_dataset.py b/app/for_ai/temp_refactor_gn_dataset.py similarity index 100% rename from app/temp_refactor_gn_dataset.py rename to app/for_ai/temp_refactor_gn_dataset.py diff --git a/app/import_from_sql/all_sql_steps.py b/app/import_from_sql/all_sql_steps.py index 082edbe..0d95f30 100644 --- a/app/import_from_sql/all_sql_steps.py +++ b/app/import_from_sql/all_sql_steps.py @@ -1,6 +1,13 @@ import requests import json +import os from decimal import Decimal +from dotenv import load_dotenv + +import sys +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))) + +from app.common.elastic_helper import ElasticHelper from app.common.config_base import * from app.common.general_functions import * @@ -15,8 +22,28 @@ from s8_Relations_qanon_LWReg import * from s9_Relations_qanon_opinion import * from s10_LawReg_lwphase_Info import * from s11_Tanghih_plan_move import * +from s12_LawSection_repair_ref_state import * + +import datetime + +load_dotenv(dotenv_path='config.env') + +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_113') +# password=os.getenv('HOST_113_PASS') + +# print(password) + +path_base_map = "G:/Project2/gateway_php/repo/_other/" +elastic = ElasticHelper(host, password, "elastic", path_base_map) +# 1 # ----------------------------------------------------------------- ## ابتدا دستورات زیر را به ترتیب در دیتابیس فهرست اجرا شود # SELECT id from tl_projects where title='موضوعات درختی قانون' @@ -29,47 +56,80 @@ from s11_Tanghih_plan_move import * # DELETE mj_qa_opinion_temp # ----------------------------------------------------------------- -# cursor, cnxn = create_cursor() +with open("./data/log_all_sql_steps.txt", 'a+', encoding='utf8') as file : + file.write('='* 60 + '\n') + file.write('='* 60 + '\n') + file.write('='* 60 + '\n') + file.write('==========> start : ' + str(datetime.datetime.now()) + '\n') + +cursor, cnxn = create_cursor() ## ایجاد فهرست موضوعات قانون -#projectid = insertProejct() -#insertProjectItems(cursor, projectid) +# projectid = insertProejct() +# insertProjectItems(cursor, projectid) # 2 -#import_law_section_to_elastic(cursor) +# elastic.createIndex( index_name='mj_qa_section_temp', app_key='majles', map_name='mj_qa_section') +# import_law_section_to_elastic(cursor, elastic, "mj_qa_section_temp") +# with open("./data/log_all_sql_steps.txt", 'a+', encoding='utf8') as file : +# file.write('==========> finish import_law_section_to_elastic : ' + str(datetime.datetime.now()) + '\n') -# import_regulation_section_to_elastic(cursor) +# elastic.createIndex( index_name='mj_rg_section_temp', app_key='majles', map_name='mj_qa_section') +# import_regulation_section_to_elastic(cursor, elastic, "mj_rg_section_temp") +# with open("./data/log_all_sql_steps.txt", 'a+', encoding='utf8') as file : +# file.write('==========> finish import_regulation_section_to_elastic : ' + str(datetime.datetime.now()) + '\n') -# import_opinion_to_elastic(cursor) +# # elastic.createIndex( index_name='mj_qa_opinion_temp', app_key='majles', map_name='mj_qa_opinion') +# # import_opinion_to_elastic(cursor, elastic, "mj_qa_opinion_temp") +#with open("./data/log_all_sql_steps.txt", 'a+', encoding='utf8') as file : +# file.write('==========> finish import_opinion_to_elastic : ' + str(datetime.datetime.now()) + '\n') -### از ابتدا تا اینجا حدودا 24 ساعت کشید +# ### از ابتدا تا اینجا حدودا 24 ساعت کشید + +# import_law_section_update_ref_state(cursor, elastic, "mj_qa_section_temp") +# with open("./data/log_all_sql_steps.txt", 'a+', encoding='utf8') as file : +# file.write('==========> finish import_law_section_update_ref_state : ' + str(datetime.datetime.now()) + '\n') -# import_law_section_update_ref_state(cursor) +# import_regulation_section_update_ref_state(cursor, elastic, "mj_rg_section_temp") +# with open("./data/log_all_sql_steps.txt", 'a+', encoding='utf8') as file : +# file.write('==========> finish import_regulation_section_update_ref_state : ' + str(datetime.datetime.now()) + '\n') -# import_regulation_section_update_ref_state(cursor) +# elastic.createIndex( index_name='mj_qa_qanon_temp', app_key='majles', map_name='mj_qa_qanon') +# import_law_reg_qanon_to_elastic(cursor, elastic, "mj_qa_qanon_temp") +# with open("./data/log_all_sql_steps.txt", 'a+', encoding='utf8') as file : +# file.write('==========> finish import_law_reg_qanon_to_elastic : ' + str(datetime.datetime.now()) + '\n') +# # # # ## تا اینجا رسید و خطا داد +# import_relations_qanon_lwreg(cursor, elastic, "mj_qa_qanon_temp") +# with open("./data/log_all_sql_steps.txt", 'a+', encoding='utf8') as file : +# file.write('==========> finish import_relations_qanon_lwreg : ' + str(datetime.datetime.now()) + '\n') -# import_law_reg_qanon_to_elastic(cursor) +# # # # ## اینجا خطا داد +# import_relations_qanon_opinion(cursor, elastic, "mj_qa_qanon_temp") +# with open("./data/log_all_sql_steps.txt", 'a+', encoding='utf8') as file : +# file.write('==========> finish import_relations_qanon_opinion : ' + str(datetime.datetime.now()) + '\n') -# ## تا اینجا رسید و خطا داد -# import_relations_qanon_lwreg(cursor) +import_lawreg_lwphase_info(cursor, elastic, "mj_qa_qanon_temp") +with open("./data/log_all_sql_steps.txt", 'a+', encoding='utf8') as file : + file.write('==========> finish import_lawreg_lwphase_info : ' + str(datetime.datetime.now()) + '\n') -# ## اینجا خطا داد -# import_relations_qanon_opinion(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) +# import_law_section_repair_ref_state(cursor, elastic, "mj_qa_section_temp", "./output/log_s12.txt") +# with open("./data/log_all_sql_steps.txt", 'a+', encoding='utf8') as file : +# file.write('==========> finish import_law_section_repair_ref_state : ' + str(datetime.datetime.now()) + '\n') cursor.close() cnxn.close() + +with open("./data/log_all_sql_steps.txt", 'a+', encoding='utf8') as file : + file.write('==========> finish full : ' + str(datetime.datetime.now()) + '\n') + +# cursor, cnxn = create_cursor('db4minaei') +#### دیگر نیازی نیست و استفاده ندارد +# #####import_tangih_tree_to_list(cursor) +# import_tanghih_plan_codes(cursor) + +# cursor.close() +# cnxn.close() diff --git a/app/import_from_sql/s10_LawReg_lwphase_Info.py b/app/import_from_sql/s10_LawReg_lwphase_Info.py index 010a43b..98e0200 100644 --- a/app/import_from_sql/s10_LawReg_lwphase_Info.py +++ b/app/import_from_sql/s10_LawReg_lwphase_Info.py @@ -10,7 +10,10 @@ from app.common.config_base import * from app.common.general_functions import * from app.common.text_normalizer import TextNormalizer -def import_lawreg_lwphase_info(cursor): +def import_lawreg_lwphase_info(cursor, elastic, index_name_o) : + + text_normal = TextNormalizer() + query='SELECT ID,CAPTION FROM [Qavanin].[dbo].[cmOrganization]' cursor.execute(query) @@ -48,10 +51,9 @@ def import_lawreg_lwphase_info(cursor): ''' cursor.execute(query) - text_normal = TextNormalizer() - url = BASE_URL + "repo/majles/qaqanon/multi/update" + # url = BASE_URL + "repo/majles/qaqanon/multi/update" headers = HEADERS @@ -173,41 +175,24 @@ def import_lawreg_lwphase_info(cursor): if len(bulk_data) >= 100: total_count += len(bulk_data) print('=' * 10, ' lawreg_lwphase_info , total='+str(total_count) , str(i)+ ', id=' + eid ) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - # limit POST Content-Length 8388608 - pops_data = [] - while len(payload) > 8388608 : - el = bulk_data.pop() - total_count -= 1 - pops_data.append(el) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - - response = requests.request("POST", url, headers=headers, data=payload) - if response.status_code != 200 : - print(bulk_data) - print(response.text) - bulk_data = [] - break - - bulk_data = pops_data + elastic.updateBulkList(bulk_data, index_name_o) + bulk_data = [] # print(response) # print(response.text) # print(row.txt) - bulk_data.append(data) - + bulk_data.append( + { + '_id' : eid, + '_source' : data + } + ) # print(bulk_count) if len(bulk_data) > 0: total_count += len(bulk_data) print('=' * 10, ' lawreg_lwphase_info , total='+str(total_count) ) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - response = requests.request("POST", url, headers=headers, data=payload) - if response.status_code != 200 : - print(bulk_data) - print(response.text) - bulk_data = [] - + elastic.updateBulkList(bulk_data, index_name_o) + bulk_data = [] # print(response.text ) diff --git a/app/import_from_sql/s12_LawSection_repair_ref_state.py b/app/import_from_sql/s12_LawSection_repair_ref_state.py index 6e0856d..4518cea 100644 --- a/app/import_from_sql/s12_LawSection_repair_ref_state.py +++ b/app/import_from_sql/s12_LawSection_repair_ref_state.py @@ -179,29 +179,3 @@ def import_law_section_repair_ref_state(cursor, elastic, index_name_o, file_log) print('end success import_law_section_update_ref_state') t2= datetime.datetime.now() print(t2-t1) - - - -cursor, cnxn = create_cursor() - -load_dotenv(dotenv_path='config.env') - -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_113') -# password=os.getenv('HOST_113_PASS') - -# print(password) - -path_base_map = "G:/Project2/gateway_php/repo/_other/" -elastic = ElasticHelper(host, password, "elastic", path_base_map) - - -import_law_section_repair_ref_state(cursor, elastic, "mj_qa_section", "./output/log_s12.txt") - -cursor.close() -cnxn.close() diff --git a/app/import_from_sql/s1_LWTopic.py b/app/import_from_sql/s1_LWTopic.py index 24dd5bf..53cfb1a 100644 --- a/app/import_from_sql/s1_LWTopic.py +++ b/app/import_from_sql/s1_LWTopic.py @@ -72,7 +72,6 @@ def insert(rows, projectid, IDS_DICT, childs ): "parent": parent, } result = requests.post(BASE_URL + 'list/' + ADD_ITEM_ROUTE, data=ADD_ITEM_QUERY, headers=HEADERS) - New_ID = json.loads(result.text)["data"][0]["id"] print(str(row["ID"]) + '=' + str(New_ID)) IDS_DICT[str(row["ID"])] = {"id" : int(New_ID), 'title': row["CAPTION"]} diff --git a/app/import_from_sql/s2_LawSection_ToElastic.py b/app/import_from_sql/s2_LawSection_ToElastic.py index 4b95b79..837bcd6 100644 --- a/app/import_from_sql/s2_LawSection_ToElastic.py +++ b/app/import_from_sql/s2_LawSection_ToElastic.py @@ -15,7 +15,7 @@ from app.common.text_normalizer import TextNormalizer # cursor, cnxn = create_cursor() -def import_law_section_to_elastic(cursor) : +def import_law_section_to_elastic(cursor, elastic, index_name_o) : query = ''' select @@ -87,7 +87,7 @@ def import_law_section_to_elastic(cursor) : cursor.execute(query) text_normal = TextNormalizer() - url = BASE_URL + "repo/majles/section/multi/add" + # url = BASE_URL + "repo/majles/section/multi/add" dict_topic = json.loads(open("list_LWTopic.json").read()) headers = HEADERS @@ -126,6 +126,8 @@ def import_law_section_to_elastic(cursor) : qanon_title = text_normal.normalize_qanon( row.lawTitle ) title_type = getTitleType(qanon_title) + if(row.ISCORRECTIONLETTER == 1): + title_type = 'نامه' eid='qs'+ str(row.sectionId) @@ -147,9 +149,7 @@ def import_law_section_to_elastic(cursor) : sub_type = row.regulationType sub_type = normalYehKe(sub_type) - # other_type = 'اصلی' - # if(row.ISCORRECTIONLETTER == 1): - # other_type = 'اصلاحی' + ts_year = '' @@ -238,40 +238,29 @@ def import_law_section_to_elastic(cursor) : if len(bulk_data) >= 200: total_count += len(bulk_data) - print('=' * 5, 'law_section ===', ', total='+str(total_count) , str(i)+ ', id=' + eid , ' , lawid_current =' + lawId , ', lawid_first=' + bulk_data[0]['qanon_id']) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - # limit POST Content-Length 8388608 - pops_data = [] - while len(payload) > 8388608 : - el = bulk_data.pop() - total_count -= 1 - pops_data.append(el) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - - response = requests.request("POST", url, headers=headers, data=payload) - if response.status_code != 200 : - print(response.text) - bulk_data = [] - break - - bulk_data = pops_data + print('=' * 5, 'law_section ===', ', total='+str(total_count) , str(i)+ ', id=' + eid , ' , lawid_current =' + lawId ) + elastic.importBulkList(bulk_data, index_name_o) + bulk_data = [] # print(response) # print(response.text) # print(row.txt) - bulk_data.append(data) + + bulk_data.append( + { + '_id' : eid, + '_source' : data + } + ) if len(bulk_data) > 0: total_count += len(bulk_data) - print('=' * 5, 'law_section ===', ', total='+str(total_count) , str(i)+ ', id=' + eid , ' , lawid_current =' + lawId , ', lawid_first=' + bulk_data[0]['qanon_id']) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - response = requests.request("POST", url, headers=headers, data=payload) - - + print('=' * 5, 'law_section ===', ', total='+str(total_count) , str(i)+ ', id=' + eid , ' , lawid_current =' + lawId ) + elastic.importBulkList(bulk_data, index_name_o) + bulk_data = [] + print('end success import_law_section_to_elastic') t2= datetime.datetime.now() print(t2-t1) diff --git a/app/import_from_sql/s3_opinion_ToElastic.py b/app/import_from_sql/s3_opinion_ToElastic.py index 11540fc..c3fe68b 100644 --- a/app/import_from_sql/s3_opinion_ToElastic.py +++ b/app/import_from_sql/s3_opinion_ToElastic.py @@ -13,7 +13,7 @@ from app.common.config_base import * from app.common.general_functions import * from app.common.text_normalizer import TextNormalizer -def import_opinion_to_elastic(cursor) : +def import_opinion_to_elastic(cursor, elastic, index_name_o) : query = """ SELECT isnull(o.[ID],0) as ref_id @@ -41,7 +41,7 @@ def import_opinion_to_elastic(cursor) : cursor.execute(query) text_normal = TextNormalizer() - url = BASE_URL + "repo/majles/opinion/multi/add" # POST /repo/majles/opinion/multi/add + # url = BASE_URL + "repo/majles/opinion/multi/add" # POST /repo/majles/opinion/multi/add dict_topic = json.loads(open("list_LWTopic.json").read()) headers = HEADERS @@ -163,36 +163,26 @@ def import_opinion_to_elastic(cursor) : if len(bulk_data) >= 100: total_count += len(bulk_data) print('=' * 10, 'opinion_to_elastic , total='+str(total_count) , str(i)+ ', id=' + eid ) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - # limit POST Content-Length 8388608 - pops_data = [] - while len(payload) > 8388608 : - el = bulk_data.pop() - total_count -= 1 - pops_data.append(el) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - - response = requests.request("POST", url, headers=headers, data=payload) - if response.status_code != 200 : - print(response.text) - bulk_data = [] - break + elastic.importBulkList(bulk_data, index_name_o) + bulk_data = [] - bulk_data = pops_data # print(response) # print(response.text) # print(row.txt) - bulk_data.append(data) + bulk_data.append( + { + '_id' : eid, + '_source' : data + } + ) if len(bulk_data) > 0: total_count += len(bulk_data) print('=' * 10, ' opinion_to_elastic , total='+str(total_count) ) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - response = requests.request("POST", url, headers=headers, data=payload) + elastic.importBulkList(bulk_data, index_name_o) + bulk_data = [] print("end success import_opinion_to_elastic") t2 = datetime.datetime.now() diff --git a/app/import_from_sql/s4_RegulationSection_ToElastic.py b/app/import_from_sql/s4_RegulationSection_ToElastic.py index aa7dc66..e21cdde 100644 --- a/app/import_from_sql/s4_RegulationSection_ToElastic.py +++ b/app/import_from_sql/s4_RegulationSection_ToElastic.py @@ -16,7 +16,7 @@ from app.common.config_base import * from app.common.general_functions import * from app.common.text_normalizer import TextNormalizer -def import_regulation_section_to_elastic(cursor): +def import_regulation_section_to_elastic(cursor, elastic, index_name_o): query = ''' select s.ID as sectionId @@ -87,7 +87,7 @@ def import_regulation_section_to_elastic(cursor): cursor.execute(query) text_normal = TextNormalizer() - url = BASE_URL + "repo/majles/rgsection/multi/add" + # url = BASE_URL + "repo/majles/rgsection/multi/add" dict_topic = json.loads(open("list_LWTopic.json").read()) headers = HEADERS @@ -125,7 +125,9 @@ def import_regulation_section_to_elastic(cursor): qanon_title = text_normal.normalize_qanon( row.lawTitle ) title_type = getTitleType(qanon_title) - + if(row.ISCORRECTIONLETTER == 1): + title_type = 'نامه' + eid='qs'+ str(row.sectionId) parentId = '0' @@ -146,11 +148,6 @@ def import_regulation_section_to_elastic(cursor): sub_type = row.regulationType sub_type = normalYehKe(sub_type) - # other_type = 'اصلی' - # if(row.ISCORRECTIONLETTER == 1): - # other_type = 'اصلاحی' - - ts_year = '' if row.aproveDate : items = row.aproveDate.split("/") @@ -235,39 +232,22 @@ def import_regulation_section_to_elastic(cursor): if len(bulk_data) >= 200: total_count += len(bulk_data) - print('=' * 10, ' regulation_section , total='+str(total_count) , str(i)+ ', id=' + eid , ' , lawid_current =' + lawId , ', lawid_first=' + bulk_data[0]['qanon_id']) - - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - # limit POST Content-Length 8388608 - pops_data = [] - while len(payload) > 8388608 : - el = bulk_data.pop() - total_count -= 1 - pops_data.append(el) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - - response = requests.request("POST", url, headers=headers, data=payload) - if response.status_code != 200 : - print(response.text) - bulk_data = [] - break + print('=' * 10, ' regulation_section , total='+str(total_count) , str(i)+ ', id=' + eid , ' , lawid_current =' + lawId) + elastic.importBulkList(bulk_data, index_name_o) + bulk_data = [] - bulk_data = pops_data - # print(response) - # print(response.text) - # print(row.txt) - - bulk_data.append(data) - - + bulk_data.append( + { + '_id' : eid, + '_source' : data + } + ) if len(bulk_data) > 0: total_count += len(bulk_data) - print('=' * 10, ' regulation_section , total='+str(total_count) , str(i)+ ', id=' + eid , ' , lawid_current =' + lawId , ', lawid_first=' + bulk_data[0]['qanon_id']) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - response = requests.request("POST", url, headers=headers, data=payload) + print('=' * 10, ' regulation_section , total='+str(total_count) , str(i)+ ', id=' + eid , ' , lawid_current =' + lawId ) + elastic.importBulkList(bulk_data, index_name_o) + bulk_data = [] print('end success import_regulation_section_to_elastic') t2= datetime.datetime.now() diff --git a/app/import_from_sql/s5_LawSection_update_ref_state.py b/app/import_from_sql/s5_LawSection_update_ref_state.py index d5b6646..aae0da7 100644 --- a/app/import_from_sql/s5_LawSection_update_ref_state.py +++ b/app/import_from_sql/s5_LawSection_update_ref_state.py @@ -18,7 +18,7 @@ from app.common.text_normalizer import TextNormalizer # ضرورتا # این برنامه ضرورت دارد اجرا شود -def import_law_section_update_ref_state(cursor): +def import_law_section_update_ref_state(cursor, elastic, index_name_o) : query = ''' SELECT gl1.ID as id, @@ -52,7 +52,7 @@ def import_law_section_update_ref_state(cursor): text_normal = TextNormalizer() - url = BASE_URL + "repo/majles/section/multi/update" + # url = BASE_URL + "repo/majles/section/multi/update" dict_topic = json.loads(open("list_LWTopic.json").read()) headers = HEADERS @@ -148,11 +148,15 @@ def import_law_section_update_ref_state(cursor): data={ - 'id' : previd, 'ref_state' : ref_state_array - } + } - bulk_data.append(data) + bulk_data.append( + { + '_id' : previd, + '_source' : data + } + ) ref_state_array = [] previd = eid @@ -163,24 +167,8 @@ def import_law_section_update_ref_state(cursor): if len(bulk_data) >= 100: total_count += len(bulk_data) print('=' * 10, ' law_section_update_ref_state , total='+str(total_count) , str(i)+ ', id=' + eid) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - # limit POST Content-Length 8388608 - pops_data = [] - while len(payload) > 8388608 : - el = bulk_data.pop() - total_count -= 1 - pops_data.append(el) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - - response = requests.request("POST", url, headers=headers, data=payload) - if response.status_code != 200 : - print(response.text) - bulk_data = [] - break - - bulk_data = pops_data + elastic.updateBulkList(bulk_data, index_name_o) + bulk_data = [] # print(response) # print(response.text) # print(row.txt) @@ -190,17 +178,20 @@ def import_law_section_update_ref_state(cursor): if ref_state_array.__len__() > 0 : data={ - 'id' : previd, 'ref_state' : ref_state_array } - bulk_data.append(data) - # print(bulk_data) + bulk_data.append( + { + '_id' : previd, + '_source' : data + } + ) if len(bulk_data) > 0: total_count += len(bulk_data) print('=' * 10, ' law_section_update_ref_state , total='+str(total_count) , str(i)+ ', id=' + eid) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - response = requests.request("POST", url, headers=headers, data=payload) + elastic.updateBulkList(bulk_data, index_name_o) + bulk_data = [] # print(response.text) print('end success import_law_section_update_ref_state') diff --git a/app/import_from_sql/s6_RegulationSection_update_ref_state.py b/app/import_from_sql/s6_RegulationSection_update_ref_state.py index b21a159..c54b2b0 100644 --- a/app/import_from_sql/s6_RegulationSection_update_ref_state.py +++ b/app/import_from_sql/s6_RegulationSection_update_ref_state.py @@ -20,7 +20,7 @@ from app.common.text_normalizer import TextNormalizer # این برنامه ضرورت دارد اجرا شود -def import_regulation_section_update_ref_state(cursor): +def import_regulation_section_update_ref_state(cursor, elastic, index_name_o) : query = ''' SELECT gl1.ID as id, @@ -54,7 +54,7 @@ def import_regulation_section_update_ref_state(cursor): text_normal = TextNormalizer() - url = BASE_URL + "repo/majles/rgsection/multi/update" + # url = BASE_URL + "repo/majles/rgsection/multi/update" dict_topic = json.loads(open("list_LWTopic.json").read()) headers = HEADERS @@ -149,11 +149,16 @@ def import_regulation_section_update_ref_state(cursor): data={ - 'id' : previd, 'ref_state' : ref_state_array - } + } - bulk_data.append(data) + bulk_data.append( + { + '_id' : previd, + '_source' : data + } + ) + ref_state_array = [] previd = eid @@ -164,24 +169,8 @@ def import_regulation_section_update_ref_state(cursor): if len(bulk_data) >= 100: total_count += len(bulk_data) print('=' * 10, ' regulation_section_update_ref_state , total='+str(total_count) , str(i)+ ', id=' + eid) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - # limit POST Content-Length 8388608 - pops_data = [] - while len(payload) > 8388608 : - el = bulk_data.pop() - total_count -= 1 - pops_data.append(el) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - - response = requests.request("POST", url, headers=headers, data=payload) - if response.status_code != 200 : - print(response.text) - bulk_data = [] - break - - bulk_data = pops_data + elastic.updateBulkList(bulk_data, index_name_o) + bulk_data = [] # print(response) # print(response.text) # print(row.txt) @@ -190,18 +179,22 @@ def import_regulation_section_update_ref_state(cursor): if ref_state_array.__len__() > 0 : data={ - 'id' : previd, - 'ref_state' : ref_state_array - } - bulk_data.append(data) - # print(bulk_data) + 'ref_state' : ref_state_array + } + + bulk_data.append( + { + '_id' : previd, + '_source' : data + } + ) + if len(bulk_data) > 0: total_count += len(bulk_data) print('=' * 10, ' regulation_section_update_ref_state , total='+str(total_count) , str(i)+ ', id=' + eid) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - response = requests.request("POST", url, headers=headers, data=payload) - # print(response.text) + elastic.updateBulkList(bulk_data, index_name_o) + bulk_data = [] print('end success import_regulation_section_update_ref_state') t2= datetime.datetime.now() diff --git a/app/import_from_sql/s7_LawReg_qanon_ToElastic.py b/app/import_from_sql/s7_LawReg_qanon_ToElastic.py index d1ecb22..55786d4 100644 --- a/app/import_from_sql/s7_LawReg_qanon_ToElastic.py +++ b/app/import_from_sql/s7_LawReg_qanon_ToElastic.py @@ -12,7 +12,7 @@ from app.common.config_base import * from app.common.general_functions import * from app.common.text_normalizer import TextNormalizer -def import_law_reg_qanon_to_elastic(cursor): +def import_law_reg_qanon_to_elastic(cursor, elastic, index_name_o) : query = ''' SELECT @@ -21,6 +21,8 @@ def import_law_reg_qanon_to_elastic(cursor): --,[F_LWBASETABLEID_LAWTYPE] ,l1.[ISLAW] -- قانون ,l1.[ISREGULATION] -- مقرره + ,l1.[ISCORRECTIONLETTER] -- نامه اصلاحی + ,l1.[ISOPINION] -- آراء ,isnull(l1.APPROVEDATE,'') as aproveDate -- تاریخ تصویب ,isnull(l1.EXPIREDATE,'') as expireDate -- تاریخ انقضا --,[F_LWBASETABLEID_CLASSIFICATION] @@ -43,14 +45,30 @@ def import_law_reg_qanon_to_elastic(cursor): left JOIN cmBasetable cbt ON l2.[F_LWBASETABLEID_REGULATIONTYPE] = cbt.ID where l1.ID = l2.id ) as regulationType + ,( + SELECT isnull(op_r.CAPTION,'') as opinionType + FROM opOpinion o + left join opOpiniongiver op_r on o.F_OPOPINIONGIVERID = op_r.id + where l1.ID = o.F_LWLAWID + ) as opinionType + ,( + SELECT isnull(o.[OPINIONDATE],'') as opinionData + FROM opOpinion o + where l1.ID = o.F_LWLAWID + ) as opinionData + ,( + SELECT isnull(o.[ARCHIVENO],'') as opinionNumber + FROM opOpinion o + where l1.ID = o.F_LWLAWID + ) as opinionNumber FROM [Qavanin].[dbo].[lwLaw] l1 left JOIN cmBasetable cbt ON l1.F_LWBASETABLEID_LAWTYPE = cbt.ID left join lwLawSectionStatus lss on lss.id= l1.[F_CMBASETABLEID_LASTSTATUS] - where ( l1.ISLAW = 1 or l1.ISREGULATION = 1 ) + where ( l1.ISLAW = 1 or l1.ISREGULATION = 1 or l1.ISOPINION = 1 ) ''' - + @@ -58,7 +76,7 @@ def import_law_reg_qanon_to_elastic(cursor): text_normal = TextNormalizer() - url = BASE_URL + "repo/majles/qaqanon/multi/add" + # url = BASE_URL + "repo/majles/qaqanon/multi/add" headers = HEADERS @@ -81,8 +99,15 @@ def import_law_reg_qanon_to_elastic(cursor): title = text_normal.normalize_qanon( row.title ) - title_type = getTitleType(title) - + title_type='' + if(row.ISOPINION == 1): + title_type='' + else: + title_type = getTitleType(title) + + if(row.ISCORRECTIONLETTER == 1): + title_type = 'نامه' + eid='qq'+ str(row.Id) main_type = '' @@ -90,36 +115,60 @@ def import_law_reg_qanon_to_elastic(cursor): main_type = 'قانون' elif(row.ISREGULATION == 1): main_type = 'مقرره' + elif(row.ISOPINION == 1): + main_type = 'آراء' + ts_ref = normalYehKe(row.ts_ref) sub_type = '' if(row.ISLAW == 1): sub_type = row.lawType elif(row.ISREGULATION == 1): sub_type = row.regulationType - sub_type = normalYehKe(sub_type) + elif(row.ISOPINION == 1): + sub_type = row.opinionType + if sub_type : + sub_type = normalYehKe(sub_type) + ts_ref = normalYehKe(sub_type) + ts_ref = ts_ref.replace("رای وحدت رویه", "") + ts_ref = ts_ref.replace("رای", "") + ts_ref = ts_ref.replace("نظر", "") + ts_ref = ts_ref.replace("- اصول 85 و 138", "") + ts_ref = ts_ref.strip() + else : + sub_type = '' + ts_ref = '' + + if sub_type : + sub_type = normalYehKe(sub_type) + qanon_number = '' if(row.ISLAW == 1): qanon_number = row.LAWNO elif(row.ISREGULATION == 1): qanon_number = row.RULENO + elif(row.ISOPINION == 1): + qanon_number = row.opinionNumber - # other_type = 'اصلی' اصلاحی.... - # action_type ... - - + aproveDate='' + if(row.ISLAW == 1): + aproveDate = row.aproveDate + elif(row.ISREGULATION == 1): + aproveDate = row.aproveDate + elif(row.ISOPINION == 1): + aproveDate = row.opinionData + ts_year = '' - if row.aproveDate : - items = row.aproveDate.split("/") + if aproveDate : + items = aproveDate.split("/") if items.__len__() > 0: ts_year = items[0] - ts_ref = normalYehKe(row.ts_ref) sort_date_timestamp = -15000000000 # 9/2/1494, 12:45:44 AM # خطا یا خالی try: - sort_date_timestamp = getSortTimestamp(row.aproveDate) + sort_date_timestamp = getSortTimestamp(aproveDate) except Exception as e: sort_date_timestamp = -15000000000 # 9/2/1494, 12:45:44 AM # خطا یا خالی @@ -138,7 +187,7 @@ def import_law_reg_qanon_to_elastic(cursor): 'title': title, 'title_type': title_type, 'expire_date': expire_date, - 'ts_date': row.aproveDate, + 'ts_date': aproveDate, 'ts_year': ts_year, 'ts_ref': ts_ref, 'qanon_etebar' : qanon_etebar, @@ -148,38 +197,26 @@ def import_law_reg_qanon_to_elastic(cursor): if len(bulk_data) >= 100: total_count += len(bulk_data) print('=' * 10, ' law_reg_qanon_to_elastic , total='+str(total_count) , str(i)+ ', id=' + eid ) - - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - # limit POST Content-Length 8388608 - pops_data = [] - while len(payload) > 8388608 : - el = bulk_data.pop() - total_count -= 1 - pops_data.append(el) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - - response = requests.request("POST", url, headers=headers, data=payload) - if response.status_code != 200 : - print(response.text) - bulk_data = [] - break - - bulk_data = pops_data + elastic.importBulkList(bulk_data, index_name_o) + bulk_data = [] # print(response) # print(response.text) # print(row.txt) - bulk_data.append(data) + bulk_data.append( + { + '_id' : eid, + '_source' : data + } + ) if len(bulk_data) > 0: total_count += len(bulk_data) print('=' * 10, ' law_reg_qanon_to_elastic , total='+str(total_count) , str(i)+ ', id=' + eid ) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - response = requests.request("POST", url, headers=headers, data=payload) + elastic.importBulkList(bulk_data, index_name_o) + bulk_data = [] print('end success law_reg_qanon_to_elastic ') t2= datetime.datetime.now() diff --git a/app/import_from_sql/s8_Relations_qanon_LWReg.py b/app/import_from_sql/s8_Relations_qanon_LWReg.py index f5e6b9c..08e3627 100644 --- a/app/import_from_sql/s8_Relations_qanon_LWReg.py +++ b/app/import_from_sql/s8_Relations_qanon_LWReg.py @@ -11,7 +11,7 @@ from app.common.general_functions import * from app.common.text_normalizer import TextNormalizer -def import_relations_qanon_lwreg(cursor): +def import_relations_qanon_lwreg(cursor, elastic, index_name_o) : # اجرای کوئری SQL و خواندن داده‌ها به یک DataFrame query = """ SELECT @@ -38,7 +38,7 @@ def import_relations_qanon_lwreg(cursor): cursor.execute(query) text_normal = TextNormalizer() - url = BASE_URL + "repo/majles/qaqanon/multi/update" + # url = BASE_URL + "repo/majles/qaqanon/multi/update" headers = HEADERS @@ -134,16 +134,19 @@ def import_relations_qanon_lwreg(cursor): continue else : data={ - 'id' : prev_eid, - 'qanon_relations' : relations + 'qanon_relations' : relations + } + bulk_data.append( + { + '_id' : prev_eid, + '_source' : data } + ) total_count = total_count+1 # if total_count < 2560 : # continue - bulk_data.append(data) - prev_eid = eid relations=[] relations.append(relation) @@ -152,24 +155,8 @@ def import_relations_qanon_lwreg(cursor): if len(bulk_data) >= 10: total_count += len(bulk_data) print('=' * 10, ' relations_qanon_lwreg , total='+str(total_count) , str(i)+ ', id=' + eid ) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - # limit POST Content-Length 8388608 - pops_data = [] - while len(payload) > 8388608 : - el = bulk_data.pop() - total_count -= 1 - pops_data.append(el) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - - response = requests.request("POST", url, headers=headers, data=payload) - if response.status_code != 200 : - print(response.text) - bulk_data = [] - break - - bulk_data = pops_data + elastic.updateBulkList(bulk_data, index_name_o) + bulk_data = [] # print(response) # print(response.text) # print(row.txt) @@ -178,33 +165,22 @@ def import_relations_qanon_lwreg(cursor): if len(relations) : data={ - 'id' : prev_eid, 'qanon_relations' : relations + } + bulk_data.append( + { + '_id' : prev_eid, + '_source' : data } - bulk_data.append(data) + ) - while len(bulk_data) > 0 : + + if len(bulk_data) > 0 : total_count += len(bulk_data) print('=' * 10, ' relations_qanon_lwreg , total='+str(total_count)) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - pops_data = [] - while len(payload) > 8388608 : - el = bulk_data.pop() - total_count -= 1 - pops_data.append(el) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - response = requests.request("POST", url, headers=headers, data=payload) - if response.status_code != 200 : - print(bulk_data) - print(response.text) - bulk_data = [] - - bulk_data = pops_data - if not bulk_data : - break + elastic.updateBulkList(bulk_data, index_name_o) + bulk_data = [] t2= datetime.datetime.now() diff --git a/app/import_from_sql/s9_Relations_qanon_opinion.py b/app/import_from_sql/s9_Relations_qanon_opinion.py index 4a0b99e..31dfe4c 100644 --- a/app/import_from_sql/s9_Relations_qanon_opinion.py +++ b/app/import_from_sql/s9_Relations_qanon_opinion.py @@ -10,7 +10,7 @@ from app.common.config_base import * from app.common.general_functions import * from app.common.text_normalizer import TextNormalizer -def import_relations_qanon_opinion(cursor): +def import_relations_qanon_opinion(cursor, elastic, index_name_o) : # اجرای کوئری SQL و خواندن داده‌ها به یک DataFrame query = """ SELECT @@ -39,7 +39,7 @@ def import_relations_qanon_opinion(cursor): cursor.execute(query) text_normal = TextNormalizer() - url = BASE_URL + "repo/majles/qaqanon/multi/update" + # url = BASE_URL + "repo/majles/qaqanon/multi/update" headers = HEADERS @@ -138,10 +138,14 @@ def import_relations_qanon_opinion(cursor): continue else : data={ - 'id' : prev_eid, 'opinion_relations' : relations } - bulk_data.append(data) + bulk_data.append( + { + '_id' : prev_eid, + '_source' : data + } + ) prev_eid = eid relations=[] @@ -151,25 +155,8 @@ def import_relations_qanon_opinion(cursor): if len(bulk_data) >= 10: total_count += len(bulk_data) print('=' * 10, ' relations_qanon_opinion , total='+str(total_count) , str(i)+ ', id=' + eid ) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - # limit POST Content-Length 8388608 - pops_data = [] - while len(payload) > 8388608 : - el = bulk_data.pop() - total_count -= 1 - pops_data.append(el) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - - response = requests.request("POST", url, headers=headers, data=payload) - if response.status_code != 200 : - print(bulk_data) - print(response.text) - bulk_data = [] - break - - bulk_data = pops_data + elastic.updateBulkList(bulk_data, index_name_o) + bulk_data = [] # print(response) # print(response.text) # print(row.txt) @@ -178,32 +165,20 @@ def import_relations_qanon_opinion(cursor): if len(relations) > 0 : data={ - 'id' : prev_eid, 'opinion_relations' : relations } - bulk_data.append(data) + bulk_data.append( + { + '_id' : prev_eid, + '_source' : data + } + ) - while len(bulk_data) > 0 : + if len(bulk_data) > 0 : total_count += len(bulk_data) print('=' * 10, ' relations_qanon_opinion , total='+str(total_count)) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - pops_data = [] - while len(payload) > 8388608 : - el = bulk_data.pop() - total_count -= 1 - pops_data.append(el) - payload = json.dumps(bulk_data, cls=JSONEncoder) #Works! - - response = requests.request("POST", url, headers=headers, data=payload) - if response.status_code != 200 : - print(bulk_data) - print(response.text) - bulk_data = [] - - bulk_data = pops_data - if not bulk_data : - break + elastic.updateBulkList(bulk_data, index_name_o) + bulk_data = [] t2= datetime.datetime.now() diff --git a/app/parvande_qanon/excel_qavanin_procces.py b/app/parvande_qanon/excel_qavanin_procces.py new file mode 100644 index 0000000..fcec966 --- /dev/null +++ b/app/parvande_qanon/excel_qavanin_procces.py @@ -0,0 +1,463 @@ +import pandas as pd +import os +import re +from tqdm import tqdm +import unicodedata +import logging + +import sys +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))) + + +logging.basicConfig( + level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s" +) + +base_folder = r"E:\pdf advar" + +# بعد انقلاب +col_shomare_parvande_after = "شماره پرونده" +col_doreh_after = "دوره قانونگذاری" +col_ts_ref = "مرجع تصویب" + +# قبل انقلاب +col_shomare_koli_before = "شماره کلی" +col_shomare_parvande_before = "شماره پرونده و ردیف " +col_tarikh_before = "تاريخ‌تصويب 1" +col_doreh_before = "دوره قانونگذاری" +col_lib_folder_before = "شماره فولدر کتابخانه" + +error_descriptions = { + "پوشه دوره پیدا نشد": "دوره قانونی در مسیر مشخص وجود ندارد، پوشه متناظر با دوره پیدا نشد.", + "مسیر دوره وجود ندارد": "مسیر دوره در سیستم وجود ندارد (احتمالاً مسیر اصلی اشتباه است).", + "پوشه پیدا نشد": "پوشه با شماره پرونده مشخص در مسیر دوره وجود ندارد.", + "نبود فایل": "هیچ فایل PDF یا عکس در پوشه یا زیرپوشه پیدا نشد.", + "بدون خطا": "پوشه و فایل‌ها موجود هستند و تطابق لازم برقرار است.", + "عدم تطابق با شماره فولدر کتابخانه": "فایل عکس موجود است اما نام آن با شماره فولدر کتابخانه تطابق ندارد.", + "خطای زیر پوشه": "پوشه شامل زیرپوشه است، بررسی فایل‌ها طبق قوانین انجام می‌شود.", + "خطای زیر پوشه / وجود فایل / بدون خطا": "زیرپوشه دارد و فایل PDF یا عکس مطابق شماره فولدر موجود است، بدون خطا ثبت می‌شود.", + "خطای زیر پوشه / وجود فایل / عدم تطابق با شماره فولدر کتابخانه": "زیرپوشه دارد و فایل عکس موجود است اما نام فایل مطابق شماره فولدر نیست.", + "دوره نامعتبر": "دوره قانونگذاری به صورت متنی است و عدد آن قابل استخراج نیست.", + "دوره نامعتبر (عدد X خارج از محدوده 1-12)": "عدد استخراج‌شده از دوره خارج از محدوده مجاز است.", + "فایل یا پوشه ای با این شماره پرونده پیدا نشد": "در مسیر مربوطه، هیچ فایل یا پوشه‌ای با این نام وجود ندارد.", + "مطابق با الگو نبود": "شماره پرونده با الگوی تعریف‌شده مطابقت ندارد.", + "دوره (مجلس تشخیص)": "مصوبه مجلس تشخیص", +} + + +doreh_to_folder_after = {str(i): f"d.{i}" for i in range(1, 13)} # d.1 تا d.12 + +doreh_to_folder_before = { + "اول": "d1-ok", + "دوم": "d2-ok", + "سوم": "d3-ok", + "چهارم": "d4-ok", + "پنجم": "d5-ok", + "ششم": "d6-ok", + "هفتم": "d7-ok", + "هشتم": "d8-ok", + "نهم": "d9-ok", + "دهم": "d10-ok", + "یازدهم": "d11-ok", + "دوازدهم": "d12-ok", + "سیزدهم": "d13-ok", + "چهاردهم": "d14-ok", + "پانزدهم": "d15-ok", + "شانزدهم": "d16-ok", + "هفدهم": "d17-ok", + "هجدهم": "d18-ok", + "نوزدهم": "d19-ok", + "بیستم": "d20-ok", + "بیست و یکم": "d21-ok", + "بیست و دوم": "d22-ok", + "بیست و سوم": "d23-ok", + "بیست و چهارم": "d24-ok", +} + +# الگوی شماره پرونده بعد انقلاب +pattern_after = r"^\d+(?:\s*مکرر)?(?:/|\s*)?ش?\s*(?:مکرر)?\d*$" + +# الگوی قبل انقلاب +pattern_before = r"^\d+$|^\d+\s*مکرر\d*$" + + +# نرمال‌سازی برای مقایسه دقیق +def normalize_str(s): + if not isinstance(s, str): + return "" + return unicodedata.normalize("NFKC", s).replace(" ", "").casefold() + + +# استخراج عدد +def extract_period_number(text): + if not isinstance(text, str): + return None + text = text.strip().lower() + + num_match = re.match(r"^(\d+)", text) + if num_match: + return int(num_match.group(1)) + + number_map = { + "اول": 1, + "دوم": 2, + "سوم": 3, + "چهارم": 4, + "پنجم": 5, + "ششم": 6, + "هفتم": 7, + "هشتم": 8, + "نهم": 9, + "دهم": 10, + "یازدهم": 11, + "دوازدهم": 12, + } + for word, num in number_map.items(): + if word in text: + return num + + return None + + + + +def normalize_file_number(s): + if not isinstance(s, str): + return "" + s = s.translate(str.maketrans("۰۱۲۳۴۵۶۷۸۹", "0123456789")) + s = unicodedata.normalize("NFKC", s) + s = s.replace(" ", "").replace("/", "").casefold() + return s + +# --- پردازش بعد انقلاب --- +def process_after_simple(df, period_map, base_subfolder_name): + df = df.copy() + df["وجود فایل"] = "" + df["تطابق با الگو"] = "" + df["مدیریت خطا"] = "" + df["مسیر"] = "" + df["فایلها"] = "" + + + folder_cache = {} + + + for idx, row in tqdm(df.iterrows(), total=len(df), desc="پردازش بعد انقلاب"): + try: + + full_path='' + name_files='' + ts_ref_val = ( + str(row[col_ts_ref]).strip() + if not pd.isna(row[col_ts_ref]) + else "" + ) + + shomare_parvande_val = ( + str(row[col_shomare_parvande_after]).strip() + if not pd.isna(row[col_shomare_parvande_after]) + else "" + ) + doreh_val = ( + str(row[col_doreh_after]).strip() + if not pd.isna(row[col_doreh_after]) + else "" + ) + + if doreh_val=='اول': + doreh_val='1' + elif doreh_val=='دوم': + doreh_val='2' + elif doreh_val=='سوم': + doreh_val='3' + elif doreh_val=='چهارم': + doreh_val='4' + elif doreh_val=='پنجم': + doreh_val='5' + elif doreh_val=='ششم': + doreh_val='6' + elif doreh_val=='هفتم': + doreh_val='7' + elif doreh_val=='هشتم': + doreh_val='8' + elif doreh_val=='نهم': + doreh_val='9' + elif doreh_val=='دهم': + doreh_val='10' + elif doreh_val=='یازدهم': + doreh_val='11' + elif doreh_val=='دوازدهم': + doreh_val='12' + elif doreh_val=='سیزدهم': + doreh_val='13' + elif doreh_val in ["...", "…", "........."]: + if ts_ref_val == 'شوراي انقلاب جمهوري اسلامي ايران' : + doreh_val='شورای انقلاب' + elif ts_ref_val == 'مجمع تشخيص مصلحت نظام' : + df.at[idx, "وجود فایل"] = "ندارد" + df.at[idx, "تطابق با الگو"] = "غیر مطابق" + df.at[idx, "مدیریت خطا"] = "دوره نامعتبر" + continue + else : + df.at[idx, "وجود فایل"] = "ندارد" + df.at[idx, "تطابق با الگو"] = "غیر مطابق" + df.at[idx, "مدیریت خطا"] = "دوره نامعتبر" + continue + + full_path = '' + if doreh_val == 'شورای انقلاب': + shomare_parvande_val = shomare_parvande_val.replace("/", "") + search_name = shomare_parvande_val + norm_search = normalize_file_number(search_name) + full_path = os.path.join( + base_folder, + base_subfolder_name, + "shorayeh enghelab", + "مصوبات به تفکیک شمار پرونده" + ) + + else : + search_name=shomare_parvande_val + shomare_parvande_val=shomare_parvande_val.replace(".", "/") + # parts = shomare_parvande_val.split("/", 1) + parts = shomare_parvande_val.split("/") + if len(parts) == 2 : + search_name = parts[1].strip() + if doreh_val=='': + doreh_val = parts[0].strip() + else: + search_name = parts[0].strip() + + norm_search = normalize_file_number(search_name) + period_num = doreh_val + period_folder = period_map.get(str(period_num)) + + if not period_folder: + df.at[idx, "وجود فایل"] = "ندارد" + df.at[idx, "تطابق با الگو"] = "غیر مطابق" + df.at[idx, "مدیریت خطا"] = "دوره نامعتبر" + continue + + full_path = os.path.join( + base_folder, base_subfolder_name, period_folder + ) + + if full_path not in folder_cache: + folder_cache[full_path] = ( + set(os.listdir(full_path)) + if os.path.exists(full_path) and os.path.isdir(full_path) + else set() + ) + + if not folder_cache[full_path]: + logging.warning(f"پوشه وجود ندارد یا خالی: {full_path}") + + folder_contents = folder_cache[full_path] + + found_file_name = None + for f in folder_contents: + root, ext = os.path.splitext(f) + if normalize_file_number(root).startswith(norm_search): + found_file_name = f + break + + # df.at[idx, "وجود فایل"] = "دارد" if found_file_name else "ندارد" + # df.at[idx, "مسیر"] = (full_path +"/" + norm_search).replace(base_folder,'') + + if not found_file_name : + df.at[idx, "مسیر"] = full_path.replace(base_folder,'') + df.at[idx, "وجود فایل"] = "ندارد" + df.at[idx, "تطابق با الگو"] = "غیر مطابق" + df.at[idx, "مدیریت خطا"] = ( + "فایل یا پوشه ای با این شماره پرونده پیدا نشد" + ) + + else : + df.at[idx, "وجود فایل"] = "دارد" + df.at[idx, "مسیر"] = full_path.replace(base_folder,'') + name_files = os.path.basename(found_file_name) + ',' + df.at[idx, "فایلها"] = name_files + + if re.match(pattern_after, normalize_file_number(shomare_parvande_val)): + df.at[idx, "تطابق با الگو"] = "مطابق" + df.at[idx, "مدیریت خطا"] = "بدون خطا" + else: + df.at[idx, "تطابق با الگو"] = "غیر مطابق" + df.at[idx, "مدیریت خطا"] = "مطابق با الگو نبود" + + except Exception as e: + df.at[idx, "وجود فایل"] = "نامشخص" + df.at[idx, "تطابق با الگو"] = "نامشخص" + df.at[idx, "مدیریت خطا"] = f"خطا در ردیف {idx}: {str(e)}" + + return df + + +# --- پردازش قبل انقلاب --- +def process_dataframe_before(df, period_map, base_subfolder): + df = df.copy() + df["وضعیت وجود پوشه"] = "" + df["تطابق با الگو"] = "" + df["بررسی زیر پوشه"] = "" + df["وجود فایل"] = "" + df["مدیریت خطا"] = "" + df["مسیر"] = "" + df["فایلها"] = "" + + for idx, row in tqdm(df.iterrows(), total=len(df), desc=f"پردازش {base_subfolder}"): + try: + shomare_parvande_val = str(row[col_shomare_parvande_before]).strip() + doreh_val = str(row[col_doreh_before]).strip() + lib_folder_val = str(row[col_lib_folder_before]).strip() + + period_folder = period_map.get(doreh_val) + if not period_folder: + df.at[idx, "وضعیت وجود پوشه"] = "ندارد" + df.at[idx, "تطابق با الگو"] = "غیر مطابق" + df.at[idx, "مدیریت خطا"] = "پوشه دوره پیدا نشد" + continue + + target_folder_name_clean = shomare_parvande_val.replace(" ", "").strip() + full_path = os.path.join(base_folder, base_subfolder, period_folder, target_folder_name_clean) + df.at[idx, "مسیر"] = full_path.replace(base_folder,'') + found_folders = [] + # print(full_path) + if not os.path.exists(full_path): + df.at[idx, "وضعیت وجود پوشه"] = "ندارد" + df.at[idx, "تطابق با الگو"] = "غیر مطابق" + df.at[idx, "مدیریت خطا"] = "پوشه پیدا نشد" + continue + + # for d in os.listdir(full_path): + # folder_path = os.path.join(full_path, d) + # if ( + # os.path.isdir(folder_path) + # and d.replace(" ", "").strip() == target_folder_name_clean + # ): + # found_folders.append(folder_path) + # if not found_folders: + # df.at[idx, "وضعیت وجود پوشه"] = "ندارد" + # df.at[idx, "تطابق با الگو"] = "غیر مطابق" + # df.at[idx, "مدیریت خطا"] = "پوشه پیدا نشد" + # continue + + df.at[idx, "وضعیت وجود پوشه"] = "دارد" + df.at[idx, "تطابق با الگو"] = ( + "مطابق" + if re.match(pattern_before, shomare_parvande_val.replace(" ", "")) + else "غیر مطابق" + ) + + has_file = False + pdf_found = False + subfolder_error = "" + matched_file = False + + name_files= '' + + for root, dirs, files in os.walk(full_path): + df.at[idx, "بررسی زیر پوشه"] = "دارد" if dirs else "ندارد" + if dirs: + subfolder_error = "خطای زیر پوشه" + for f in files: + f_lower = f.lower() + name_files += os.path.basename(f_lower) + ',' + + if f_lower.endswith(".pdf"): + pdf_found = True + has_file = True + elif f_lower.endswith( + (".jpg", ".jpeg", ".png", ".tif", ".bmp") + ): + has_file = True + if ( + lib_folder_val + and lib_folder_val.lower() != "nan" + and lib_folder_val.replace(" ", "").strip() + in os.path.splitext(f)[0].replace(" ", "").strip() + ): + matched_file = True + + if not has_file: + df.at[idx, "وجود فایل"] = "ندارد" + df.at[idx, "مدیریت خطا"] = ( + subfolder_error if subfolder_error else "نبود فایل" + ) + else: + df.at[idx, "وجود فایل"] = "دارد" + if subfolder_error: + if pdf_found or matched_file: + df.at[idx, "مدیریت خطا"] = ( + f"{subfolder_error} / وجود فایل / بدون خطا" + ) + else: + df.at[idx, "مدیریت خطا"] = ( + f"{subfolder_error} / وجود فایل / عدم تطابق با شماره فولدر کتابخانه" + ) + else: + if pdf_found or matched_file: + df.at[idx, "مدیریت خطا"] = "بدون خطا" + else: + df.at[idx, "مدیریت خطا"] = "عدم تطابق با شماره فولدر کتابخانه" + + df.at[idx, "فایلها"] = name_files + + + except Exception as e: + df.at[idx, "وضعیت وجود پوشه"] = "نامشخص" + df.at[idx, "تطابق با الگو"] = "نامشخص" + df.at[idx, "مدیریت خطا"] = str(e) + + return df + + +def prepare_error_report(result_df, sheet_name): + df = result_df.copy() + counts = df["مدیریت خطا"].value_counts().reset_index() + counts.columns = ["خطا", "تعداد"] + counts["زمان"] = sheet_name + counts["توضیح"] = counts["خطا"].map(error_descriptions) + return counts[["خطا", "زمان", "توضیح", "تعداد"]] + + +def main_proccess(): + # excel_file = "data/qavanin_files/qavanin.xlsx" + # output_file = "data/qavanin_files/qavanin_output2.xlsx" + # df_before = pd.read_excel(excel_file, sheet_name=0) + # df_after = pd.read_excel(excel_file, sheet_name=1) + + excel_file1 = "data/qavanin_files/فهرست تمام قوانین_1_ 1 الی2378-رشیدزاده.xlsx" + excel_file2 = "data/qavanin_files/فهرست تمام قوانین_2_تکمیل شده.xlsx" + output_file = "data/qavanin_files/qavanin_output4.xlsx" + df_before = pd.read_excel(excel_file1, sheet_name=0) + df_after = pd.read_excel(excel_file2, sheet_name=0) + + + result_before = process_dataframe_before( + df_before, + doreh_to_folder_before, + os.path.join("ghabl az enghelab", "majlis shorayeh melli"), + ) + result_after = process_after_simple( + df_after, doreh_to_folder_after, "baed az enghelab eslami" + ) + + + + errors_before = prepare_error_report(result_before, "قبل انقلاب") + errors_after = prepare_error_report(result_after, "بعد انقلاب") + + errors_combined = pd.concat([errors_before, errors_after], ignore_index=True) + + os.makedirs("files", exist_ok=True) + with pd.ExcelWriter(output_file, engine="openpyxl") as writer: + result_before.to_excel(writer, index=False, sheet_name="قبل انقلاب") + result_after.to_excel(writer, index=False, sheet_name="بعد انقلاب") + errors_combined.to_excel(writer, index=False, sheet_name="گزارش کلی") + + print(f"✅ خروجی نهایی ذخیره شد در: {output_file}") + + + +if __name__ == "__main__": + main_proccess() \ No newline at end of file diff --git a/app/parvande_qanon/import_qavanin_files_to_elastic.py b/app/parvande_qanon/import_qavanin_files_to_elastic.py new file mode 100644 index 0000000..5536765 --- /dev/null +++ b/app/parvande_qanon/import_qavanin_files_to_elastic.py @@ -0,0 +1,558 @@ +import pandas as pd +import os +import re +from tqdm import tqdm +import unicodedata +import logging + +import sys +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))) + + + +from ..common.text_normalizer import TextNormalizer +# from general import * +from ..common.general_functions import * +from ..common.elastic_helper import ElasticHelper + + +# --------------------------------------------- +# قبل انقلاب +# خواندن اطلاعات اکسل و درج در qaqanon +# ....... تصمیمات قانونی داخل اکسل فیلد نوع دارند +# --------------------------------------------- + +# --------------------------------------------- +# بعد انقلاب +# خواندن اطلاعات اکسل و درج در qaqanon +# برای تصمیمات قانونی، خواندن اکسل مخصوص و درج در qaqanon +# --------------------------------------------- + +def import_excel_before_to_elastic(elastic, path_file, index_name_o): + bulk_data_import=[] + bulk_data_update=[] + total_count = 0 + count = 0 + id = "" + try: + + data = excel_to_json(path_file, None, 0) + + print('*' * 20 , ' count=', len(data)) + cols = [ + "شماره کلی", + "شماره ردیف با احتساب مکرر", + "شماره پرونده و ردیف ", + "دوره قانونگذاری", + "عنوان", + "تاریخ تصویب در dotic ", + "تاريخ‌تصويب 1", + "مرجع تصويب ", + "تاریخ تصویب 2", + "مرجع تصویب 2", + "نوع", + "شماره پرونده های مرتبط", + "وضعيت", + "اصلی/تبعی", + "بررسی کننده", + "تایید نهایی", + "شماره فولدر کتابخانه", + "توضیحات", + "شماره پرونده سنا", + "_id", + # "error", + # "Unnamed: 21", + # "Unnamed: 22", + # "Unnamed: 23", + # "Unnamed: 24", + # "وضعیت وجود پوشه", + # "تطابق با الگو", + # "بررسی زیر پوشه", + # "وجود فایل", + "مدیریت خطا", + "مسیر", + "فایلها" + ] + + text_normalizer = TextNormalizer() + for item in data: + count += 1 + + error_files_state = item.get("مدیریت خطا", "") + title = item.get("عنوان", "") + title = text_normalizer.normalize_qanon(title) + + sub_type = item.get("نوع", "") + sub_type = text_normalizer.normalize_qanon(sub_type) + + _id = item.get("_id", "") + davam_type = '' + eid = _id + + number_all = item.get("شماره کلی", "") + + + number_row_duplicate = item.get("شماره ردیف با احتساب مکرر", "") + number_row_duplicate = number_row_duplicate if not '..' in number_row_duplicate else '' + + number_row = item.get("شماره پرونده و ردیف ", "") + number_row = number_row if not '..' in number_row else '' + + number_lib_folder = item.get("شماره فولدر کتابخانه", "") + number_lib_folder = number_lib_folder if not '..' in number_lib_folder else '' + + number_sena = item.get("شماره پرونده سنا", "") + number_sena = number_sena if not '..' in number_sena else '' + + description = item.get("توضیحات", "") + description = text_normalizer.normalize_qanon(description) + + term = item.get("دوره قانونگذاری", "") # ???? term + term = text_normalizer.normalize_qanon(term) + term = term if not '..' in term else '' + + ts_date_dotic = item.get("تاریخ تصویب در dotic ", "") + if not is_match_persian_date_format(ts_date_dotic): + ts_date_dotic = '' + + + ts_date1 = item.get("تاريخ‌تصويب 1", "") + if not is_match_persian_date_format(ts_date1): + ts_date1 = '' + + ts_ref1 = item.get("مرجع تصويب ", "") # ????? ts_ref + ts_ref1 = text_normalizer.normalize_qanon(ts_ref1) + ts_ref1 = ts_ref1 if not '..' in ts_ref1 else '' + + ts_date2 = item.get("تاریخ تصویب 2", "") + if not is_match_persian_date_format(ts_date2): + ts_date2 = '' + + ts_ref2 = item.get("مرجع تصویب 2", "") + ts_ref2 = text_normalizer.normalize_qanon(ts_ref2) + ts_ref2 = ts_ref2 if not '..' in ts_ref2 else '' + + qanon_etebar = item.get("وضعيت", "") + qanon_etebar = text_normalizer.normalize_qanon(qanon_etebar) + qanon_etebar = qanon_etebar if not '..' in qanon_etebar else '' + + path_folder = item.get("مسیر", "") + name_files = item.get("فایلها", "") + + # title = item.get("شماره پرونده های مرتبط", "") # فیلد معادل ندارد + # title = item.get("اصلی/تبعی", "") # فیلد معادل ندارد + # title = item.get("بررسی کننده", "") # فیلد معادل ندارد + # title = item.get("تایید نهایی", "") # فیلد معادل ندارد + + main_type='قانون' + if sub_type == 'تصمیم قانونی' : + main_type = 'تصمیم قانونی' + sub_type='' + elif sub_type == 'علدی' : + sub_type='عادی' + elif sub_type == '...' : + if title.startswith('تصمیم قانونی') or title.startswith('تصویب نامه قانونی') : + sub_type='' + main_type = 'تصمیم قانونی' + else : + sub_type='بودجه' + else: + print('.#'*10,'error subtype , ', count) + + is_update = True + if not _id.startswith('qq') : + eid = 0 + is_update= False + if sub_type =='تصمیم قانونی' : + eid='qt_'+ uuid.uuid4().hex[:8] + else : + eid='qe_'+ uuid.uuid4().hex[:8] + sub_type='نامشخص' + if _id=='قانون جدید - موقت' : + davam_type='موقت' + sub_type='عادی' + + + files_info=[] + for name in name_files.split(','): + if not name : + continue + file_type = '' + if name.endswith(".pdf"): + file_type="pdf" + elif name.endswith( + (".jpg", ".jpeg", ".png", ".tif", ".bmp") + ): + file_type="img" + else : + file_type="" + files_info.append({ + "path": os.path.join(path_folder, name), + "file_name": name, + "title": name, + "type": file_type + }) + + + + data = { + "id": eid, + "title": title, + "main_type": main_type, + "sub_type": sub_type, + "term": term, + "qanon_etebar": qanon_etebar, + "davam_type": davam_type, + "ts_date_dotic": ts_date_dotic, + "ts_date1": ts_date1, + "ts_ref1": ts_ref1, + "ts_date2": ts_date2, + "ts_ref2": ts_ref2, + "description": description, + "files": files_info, + "number" :{ + "all" : number_all, + "row_duplicate" : number_row_duplicate, + "row" : number_row, + "lib_folder" : number_lib_folder, + "sena" : number_sena + } + } + + if is_update : + bulk_data_update.append({ + "_id": id, + "_source": data + }) + else : + bulk_data_import.append({ + "_id": id, + "_source": data + }) + + + if len(bulk_data_update) >= 100: + total_count += len(bulk_data_update) + print('=' * 10, ' update , total='+str(total_count) , str(count)) + elastic.updateBulkList(bulk_data_update, index_name_o) + bulk_data_update = [] + + if len(bulk_data_import) >= 100: + total_count += len(bulk_data_import) + print('=' * 10, ' import , total='+str(total_count) , str(count)) + elastic.importBulkList(bulk_data_import, index_name_o) + bulk_data_import = [] + + if len(bulk_data_update): + total_count += len(bulk_data_update) + print('=' * 10, ' update , total='+str(total_count) , str(count)) + elastic.updateBulkList(bulk_data_update, index_name_o) + bulk_data_update = [] + + if len(bulk_data_import): + total_count += len(bulk_data_import) + print('=' * 10, ' import , total='+str(total_count) , str(count)) + elastic.importBulkList(bulk_data_import, index_name_o) + bulk_data_import = [] + + except Exception as e: + print("Exception: " + str(e)) + + + +def import_excel_after_to_elastic(elastic, path_file, index_name_o): + bulk_data_import=[] + bulk_data_update=[] + total_count = 0 + count = 0 + id = "" + try: + + data = excel_to_json(path_file, None, 0) + + print('*' * 20 , ' count=', len(data)) + cols = [ + "شماره عمومی", + "شماره رديف", + "شماره پرونده", + "دوره قانونگذاری", + "عنوان", + "تاریخ تصویب", + "مرجع تصویب", + "تاریخ تایید", + "وضعيت", + "شماره روزنامه رسمی کشور", + "تاریخ انتشار روزنامه رسمی کشور", + "شماره شناسه قانون", + "شماره پرونده های مرتبط", + "اصلی/تبعی", + "مستندات", + " تصدیق کنندگان فایل word قانون با pdf", + "توضیحات تصدیق", + "تاریخ لازم الاجرا شدن", + " تطبیق کنندگان فایلpdf با روزنامه رسمی", + "توضیحات تطبیق فایلpdf با روزنامه رسمی", + "_id", + "error", + "وجود فایل", + "تطابق با الگو", + "مدیریت خطا", + "مسیر", + "فایلها" + ] + + text_normalizer = TextNormalizer() + for item in data: + count += 1 + + error_files_state = item.get("مدیریت خطا", "") + title = item.get("عنوان", "") + title = text_normalizer.normalize_qanon(tile) + _id = item.get("_id", "") + davam_type = '' + eid = _id + + number_all = item.get("شماره عمومی", "") + number_row_duplicate = item.get("شماره ردیف", "") + number_row = item.get("شماره پرونده ", "") + + ts_date = item.get("تاريخ‌تصويب", "") + if not is_match_persian_date_format(ts_date): + ts_date = '' + + ts_ref = item.get("مرجع تصويب", "") # ????? ts_ref + ts_ref = text_normalizer.normalize_qanon(ts_ref) + + shora_date = item.get("تاریخ تایید", "") + if not is_match_persian_date_format(shora_date): + shora_date = '' + exec_date = item.get("تاریخ لازم الاجرا شدن", "") + if not is_match_persian_date_format(exec_date): + exec_date = '' + + rrk_number = item.get("شماره روزنامه رسمی کشور", "") + rrk_number = rrk_number if not '..' in rrk_number else '' + + rrk_date = item.get("تاریخ انتشار روزنامه رسمی کشور", "") + if not is_match_persian_date_format(rrk_date): + rrk_date = '' + + + number_qanon = item.get("شماره شناسه قانون", "") + + description = item.get("مستندات", "") + description = text_normalizer.normalize_qanon(description) + + term = item.get("دوره قانونگذاری", "") # ???? term + term = text_normalizer.normalize_qanon(term) + term = term if not '..' in term else '' + + qanon_etebar = item.get("وضعيت", "") + qanon_etebar = text_normalizer.normalize_qanon(qanon_etebar) + + path_folder = item.get("مسیر", "") + name_files = item.get("فایلها", "") + + # title = item.get("شماره پرونده های مرتبط", "") # فیلد معادل ندارد - تبعی های مرتبط و مثل این منظورهست که خودکار پر میشود یا سامانه می دهد + # title = item.get("اصلی/تبعی", "") # فیلد معادل ندارد + # title = item.get("بررسی کننده", "") # فیلد معادل ندارد + # title = item.get("تایید نهایی", "") # فیلد معادل ندارد + + main_type='قانون' + sub_type = 'عادی' + + letters = [] + if shora_date : + letters.append({ + "type" : "تایید شورای نگهبان", + "date" : shora_date + }) + + if rrk_number or rrk_date : + letters.append({ + "type" : "انتشار در روزنامه رسمی", + "number" : rrk_number, + "date" : rrk_date + }) + + + + is_update = True + if not _id.startswith('qq') : + eid = 0 + is_update= False + eid='qe_'+ uuid.uuid4().hex[:8] + sub_type='نامشخص' + + + files_info=[] + for name in name_files.split(','): + if not name : + continue + file_type = '' + if name.endswith(".pdf"): + file_type="pdf" + elif name.endswith( + (".jpg", ".jpeg", ".png", ".tif", ".bmp") + ): + file_type="img" + else : + file_type="" + files_info.append({ + "path": os.path.join(path_folder, name), + "file_name": name, + "title": name, + "type": file_type + }) + + + data = { + "id": eid, + "title": title, + "main_type": main_type, + "sub_type": sub_type, + "term": term, + "qanon_etebar": qanon_etebar, + "davam_type": davam_type, + "ts_date_dotic": ts_date_dotic, + "ts_date1": ts_date1, + "ts_ref1": ts_ref1, + "ts_date2": ts_date2, + "ts_ref2": ts_ref2, + "description": description, + "files": files_info, + "number" :{ + "all" : number_all, + "row_duplicate" : number_row_duplicate, + "row" : number_row, + "lib_folder" : number_lib_folder, + "sena" : number_sena + } + } + + if is_update : + bulk_data_update.append({ + "_id": id, + "_source": data + }) + else : + bulk_data_import.append({ + "_id": id, + "_source": data + }) + + + if len(bulk_data_update) >= 100: + total_count += len(bulk_data_update) + print('=' * 10, ' update , total='+str(total_count) , str(count)) + elastic.updateBulkList(bulk_data_update, index_name_o) + bulk_data_update = [] + + if len(bulk_data_import) >= 100: + total_count += len(bulk_data_import) + print('=' * 10, ' import , total='+str(total_count) , str(count)) + elastic.importBulkList(bulk_data_import, index_name_o) + bulk_data_import = [] + + if len(bulk_data_update): + total_count += len(bulk_data_update) + print('=' * 10, ' update , total='+str(total_count) , str(count)) + elastic.updateBulkList(bulk_data_update, index_name_o) + bulk_data_update = [] + + if len(bulk_data_import): + total_count += len(bulk_data_import) + print('=' * 10, ' import , total='+str(total_count) , str(count)) + elastic.importBulkList(bulk_data_import, index_name_o) + bulk_data_import = [] + + except Exception as e: + print("Exception: " + str(e)) + + + +def import_excel_tasmimat_to_elastic(elastic, path_file, index_name_o): + bulk_data_import=[] + total_count = 0 + count = 0 + id = "" + try: + + data = excel_to_json(path_file, None, 0) + + print('*' * 20 , ' count=', len(data)) + cols = [ + "ردیف", + "مستند قانونی", + "موضوع", + "نتیجه", + "جلسه", + "تاریخ", + ] + + text_normalizer = TextNormalizer() + for item in data: + count += 1 + + row = item.get("ردیف", "") + description = item.get("مستند قانونی", "") + description = text_normalizer.normalize_qanon(description) + + subject = item.get("موضوع", "") + subject = text_normalizer.normalize_qanon(subject) + + content = item.get("نتیجه", "") + content = text_normalizer.normalize_qanon(content) + + number = item.get("جلسه", "") + ts_date = item.get("تاریخ", "") + if not is_match_persian_date_format(ts_date): + ts_date = '' + print('.*'*10, ' error ts_date in ', row) + continue + + title = subject + ' - جلسه ' + number + ' تاریخ ' + ts_date + + main_type='تصمیم قانونی' + ts_ref='مجلس شورای اسلامی' + sub_type = '' + term = '' + + is_update = False + + eid ='qt_'+ uuid.uuid4().hex[:8] + + data = { + "id": eid, + "title": title, + "main_type": main_type, + "sub_type": sub_type, + "term": term, + "ts_date": ts_date, + "ts_ref": ts_ref, + "description": description, + "content": content + } + + bulk_data_import.append({ + "_id": id, + "_source": data + }) + + + if len(bulk_data_import) >= 100: + total_count += len(bulk_data_import) + print('=' * 10, ' import , total='+str(total_count) , str(count)) + elastic.importBulkList(bulk_data_import, index_name_o) + bulk_data_import = [] + + if len(bulk_data_import): + total_count += len(bulk_data_import) + print('=' * 10, ' import , total='+str(total_count) , str(count)) + elastic.importBulkList(bulk_data_import, index_name_o) + bulk_data_import = [] + + except Exception as e: + print("Exception: " + str(e)) + + \ No newline at end of file diff --git a/app/parvande_qanon/mj_qa_qanon.json b/app/parvande_qanon/mj_qa_qanon.json new file mode 100644 index 0000000..c7715d5 --- /dev/null +++ b/app/parvande_qanon/mj_qa_qanon.json @@ -0,0 +1,794 @@ +{ + "mappings": { + "date_detection": false, + "properties": { + "id": { + "type": "keyword" + }, + "title": { + "type": "text", + "fields": { + "fa": { + "type": "text", + "analyzer": "normal_analyzer_fa", + "search_analyzer": "normal_analyzer_fa", + "search_quote_analyzer": "phrase_analyzer_fa" + }, + "ph": { + "type": "text", + "analyzer": "phrase_analyzer_fa", + "search_analyzer": "phrase_analyzer_fa", + "search_quote_analyzer": "phrase_analyzer_fa" + }, + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "title_popular": { + "type": "text", + "analyzer": "normal_analyzer_fa", + "search_analyzer": "normal_analyzer_fa", + "search_quote_analyzer": "phrase_analyzer_fa" + }, + "content": { + "type": "text", + "fields": { + "fa": { + "type": "text", + "analyzer": "normal_analyzer_fa", + "search_analyzer": "normal_analyzer_fa", + "search_quote_analyzer": "phrase_analyzer_fa" + }, + "ph": { + "type": "text", + "analyzer": "phrase_analyzer_fa", + "search_analyzer": "phrase_analyzer_fa", + "search_quote_analyzer": "phrase_analyzer_fa" + } + } + }, + "embeddings": { + "type": "dense_vector", + "dims": 768, + "index": true, + "similarity": "cosine" + }, + "initial": { + "properties": { + "title": { + "type": "text" + }, + "content": { + "type": "text" + }, + "approuve_type": { + "type": "keyword" + }, + "creators": { + "type": "keyword" + }, + "signers": { + "type": "keyword" + }, + "approuve_number": { + "type": "text" + }, + "approuve_date": { + "type": "date" + }, + "letter_number": { + "type": "text" + }, + "letter_date": { + "type": "date" + }, + "letter_signer": { + "type": "keyword" + }, + "ministers": { + "type": "keyword" + }, + "files": { + "properties": { + "path": { + "type": "text" + }, + "file_name": { + "type": "text" + }, + "title": { + "type": "text" + } + } + } + } + }, + "receive": { + "properties": { + "term_number": { + "type": "text" + }, + "ref_law": { + "type": "keyword" + }, + "meet_number": { + "type": "text" + }, + "meet_date": { + "type": "date" + }, + "register_number": { + "type": "text" + }, + "publish_number": { + "type": "text" + }, + "handle_type": { + "type": "keyword" + }, + "handle_method": { + "type": "keyword" + } + } + }, + "refer": { + "properties": { + "refer_date": { + "type": "date" + }, + "commission_type": { + "type": "keyword" + }, + "commission_main": { + "type": "keyword" + }, + "commission_mirrors": { + "type": "keyword" + }, + "commission_common": { + "properties": { + "name": { + "type": "keyword" + }, + "member_count": { + "type": "integer" + }, + "member_names": { + "type": "keyword" + } + } + }, + "handle_85": { + "type": "keyword" + } + } + }, + "commission_report": { + "properties": { + "agendas": { + "properties": { + "number": { + "type": "text" + }, + "date": { + "type": "date" + } + } + }, + "meets": { + "properties": { + "number": { + "type": "text" + }, + "date": { + "type": "date" + } + } + }, + "report_first": { + "properties": { + "approve_type": { + "type": "keyword" + }, + "number": { + "type": "text" + }, + "date": { + "type": "date" + } + } + }, + "report_nexts": { + "properties": { + "type": { + "type": "keyword" + }, + "number": { + "type": "text" + }, + "date": { + "type": "date" + }, + "duration_85": { + "type": "date" + }, + "date_85": { + "type": "date" + } + } + } + } + }, + "parl_handle": { + "properties": { + "agendas": { + "properties": { + "number": { + "type": "text" + }, + "date": { + "type": "date" + } + } + }, + "meets": { + "properties": { + "number": { + "type": "text" + }, + "date": { + "type": "date" + } + } + }, + "agree_names": { + "type": "keyword" + }, + "against_names": { + "type": "keyword" + }, + "demands": { + "type": "keyword" + }, + "demand85_names": { + "type": "keyword" + }, + "handle_infos": { + "properties": { + "type": { + "type": "keyword" + }, + "number": { + "type": "text" + }, + "date": { + "type": "date" + }, + "duration_85": { + "type": "date" + }, + "date_85": { + "type": "date" + } + } + } + } + }, + "before_info": { + "properties": { + "ref_id": { + "type": "keyword" + }, + "plan_type": { + "type": "keyword" + }, + "discuss_type": { + "type": "keyword" + }, + "ministers": { + "type": "keyword" + }, + "creators": { + "type": "text" + }, + "register_number": { + "type": "text" + }, + "prev_number": { + "type": "text" + }, + "receipt_date": { + "type": "date" + }, + "discuss_date1": { + "type": "date" + }, + "discuss_date2": { + "type": "date" + }, + "description": { + "type": "text" + }, + "commission_type": { + "type": "keyword" + }, + "commission_main": { + "type": "keyword" + }, + "commission_mirrors": { + "type": "keyword" + }, + "content": { + "type": "text" + } + } + }, + "letters": { + "properties": { + "type": { + "type": "keyword" + }, + "sub_type": { + "type": "keyword" + }, + "order": { + "type": "float" + }, + "number": { + "type": "text" + }, + "date": { + "type": "date" + }, + "description": { + "type": "text" + }, + "content": { + "type": "text" + }, + "delay_time": { + "type": "text" + }, + "expire_date": { + "type": "date" + }, + "files": { + "properties": { + "path": { + "type": "text" + }, + "file_name": { + "type": "text" + }, + "title": { + "type": "text" + } + } + } + } + }, + "counts": { + "properties": { + "key": { + "type": "keyword" + }, + "value": { + "type": "text" + } + } + }, + "davam_type": { + "type": "keyword" + }, + "number": { + "properties": { + "row_duplicate": { + "type": "text" + }, + "lib_folder": { + "type": "text" + }, + "row": { + "type": "text" + }, + "all": { + "type": "text" + }, + "sena": { + "type": "text" + } + } + }, + "archive_info": { + "properties": { + "type": { + "type": "keyword" + }, + "number": { + "type": "text" + }, + "description": { + "type": "text" + } + } + }, + "ts_date_dotic": { + "type": "date" + }, + "ts_date1": { + "type": "date" + }, + "ts_ref1": { + "type": "keyword" + }, + "ts_date2": { + "type": "date" + }, + "ts_ref2": { + "type": "keyword" + }, + "description": { + "type": "text" + }, + "conformity_rrk": { + "type": "keyword" + }, + "conformity_qanonyar": { + "type": "keyword" + }, + "content_ocr": { + "type": "text" + }, + "qanon_etebar": { + "type": "keyword" + }, + "expire_date": { + "type": "date" + }, + "exec_date": { + "type": "date" + }, + "ref_key": { + "type": "keyword" + }, + "ts_date": { + "type": "date" + }, + "ts_year": { + "type": "integer" + }, + "ts_ref": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "term": { + "type": "keyword" + }, + "term_number": { + "type": "integer" + }, + "ranking_weight": { + "type": "integer" + }, + "main_type": { + "type": "keyword" + }, + "sub_type": { + "type": "keyword" + }, + "title_type": { + "type": "text", + "fields": { + "keyword": { + "type": "keyword", + "ignore_above": 256 + } + } + }, + "action_type": { + "type": "keyword" + }, + "section_len": { + "type": "integer" + }, + "eblagh": { + "properties": { + "number": { + "type": "text" + }, + "date": { + "type": "date" + }, + "from": { + "type": "keyword" + } + } + }, + "rrk": { + "properties": { + "number": { + "type": "text" + }, + "date": { + "type": "date" + } + } + }, + "exceuter_organs": { + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "keyword" + } + } + }, + "receiver_organs": { + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "keyword" + } + } + }, + "sort_date_timestamp": { + "type": "long" + }, + "qanon_relations": { + "properties": { + "from_type": { + "type": "keyword" + }, + "from_section_id": { + "type": "keyword" + }, + "from_section_title": { + "type": "keyword" + }, + "rel_type": { + "type": "keyword" + }, + "to_type": { + "type": "keyword" + }, + "to_id": { + "type": "keyword" + }, + "to_title": { + "type": "keyword" + }, + "wait": { + "type": "integer" + }, + "rel_key": { + "type": "keyword" + } + } + }, + "opinion_relations": { + "properties": { + "from_type": { + "type": "keyword" + }, + "from_section_id": { + "type": "keyword" + }, + "from_section_title": { + "type": "keyword" + }, + "rel_type": { + "type": "keyword" + }, + "to_type": { + "type": "keyword" + }, + "to_id": { + "type": "keyword" + }, + "to_title": { + "type": "keyword" + }, + "wait": { + "type": "integer" + }, + "rel_key": { + "type": "keyword" + } + } + }, + "fixed_date": { + "type": "date" + }, + "renewal_date": { + "type": "date" + }, + "exec_duration": { + "type": "text" + }, + "effective_date": { + "type": "date" + }, + "relation_organs": { + "type": "keyword" + }, + "files": { + "properties": { + "path": { + "type": "text" + }, + "file_name": { + "type": "text" + }, + "title": { + "type": "text" + }, + "type": { + "type": "keyword" + } + } + }, + "is_delete": { + "type": "integer" + }, + "time_edit": { + "type": "date" + }, + "doc_tags": { + "type": "keyword" + }, + "doc_states": { + "type": "keyword" + } + } + }, + "settings": { + "index.max_result_window": 15000, + "index": { + "analysis": { + "analyzer": { + "phrase_analyzer_fa": { + "type": "custom", + "tokenizer": "standard", + "char_filter": [ + "fa_char_filter" + ], + "filter": [] + }, + "normal_analyzer_fa": { + "type": "custom", + "tokenizer": "standard", + "char_filter": [ + "fa_char_filter" + ], + "filter": [ + "fa_stop" + ] + } + }, + "filter": { + "fa_stop": { + "type": "stop", + "stopwords": [ + "یا", + "را", + "این", + "با", + "آن", + "و", + "در", + "به", + "که", + "از", + "طی", + "پس", + "چه", + "اگر", + "نه", + "آنها", + "هر", + "او", + "ما", + "من", + "تا", + "نیز", + "اما", + "یک", + "بر", + "هم", + "برای", + "کن", + "کرد", + "کردن", + "باش", + "بود", + "بودن", + "شو", + "شد", + "شدن", + "‏دار", + "داشت", + "داشتن", + "‏خواه", + "خواست", + "خواستن", + "‏گوی", + "گفت", + "گفتن", + "‏گیر", + "گرفت", + "گرفتن", + "‏آی", + "آمد", + "آمدن", + "‏توان", + "توانستن", + "‏یاب", + "یافتن", + "‏آور", + "آورد", + "آوردن", + "1", + "2", + "3", + "ص", + "4", + "و", + "5", + "ج", + "6", + "a", + "top", + "href", + "pageno" + ], + "char_filter": [] + } + }, + "char_filter": { + "fa_char_filter": { + "type": "mapping", + "mappings": [ + "٠ => 0", + "١ => 1", + "٢ => 2", + "٣ => 3", + "٤ => 4", + "٥ => 5", + "٦ => 6", + "٧ => 7", + "٨ => 8", + "٩ => 9", + "ک => ك", + "ی => ي", + "ة => ه", + "إ => ا", + "أ => ا", + "آ => ا", + "ء => ا", + "َ => ", + "ُ => ", + "ِ => ", + "ّ => ", + "ً => ", + "ٌ => ", + "ٍ => ", + "ْ => " + ] + } + } + }, + "number_of_shards": "1", + "number_of_replicas": "0" + } + } +} \ No newline at end of file diff --git a/app/parvande_qanon/null.txt b/app/parvande_qanon/null.txt deleted file mode 100644 index ddffcc0..0000000 --- a/app/parvande_qanon/null.txt +++ /dev/null @@ -1 +0,0 @@ -این فایل در اولین فرصت پاک شود diff --git a/app/parvande_qanon/repair_qa_qanon_for_map_new.py b/app/parvande_qanon/repair_qa_qanon_for_map_new.py new file mode 100644 index 0000000..268c503 --- /dev/null +++ b/app/parvande_qanon/repair_qa_qanon_for_map_new.py @@ -0,0 +1,156 @@ +import numbers +import os +from dotenv import load_dotenv +from elasticsearch import Elasticsearch, helpers +import json +import re +import zipfile + + +import sys +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))) + + +from ..common.text_normalizer import TextNormalizer +# from general import * +from ..common.general_functions import * +from ..common.elastic_helper import ElasticHelper + + + +# text_normal = TextNormalizer() + + +def repair_persian_date(item, key, id, error_list, key2=''): + res = '' + path_key = key2+'.'+key if key2 else key + if key in item : + _date = item[key] + if not _date or _date == '' : + del item[key] + return item + + if _date and not is_match_persian_date_format(_date): + error_list.append({'id':id, 'key': path_key, "value":_date, "message": "match_persian_date_format" }) + del item[key] + return item + + if _date : + try : + res = jdate2Gregorian(_date) + except Exception as e: + error_list.append({'id':id, 'key': path_key, "value":_date, "message": "convert persian_date" }) + del item[key] + return item + + if res : + item[key] = res + + return item + + +def correct_qanono_data_json( data, error_list ) : + data_new = [] + for item in data : + id = item['_id'] + item['_source'] = repair_persian_date(item['_source'], 'ts_date', id, error_list, '') + item['_source'] = repair_persian_date(item['_source'], 'exec_date', id, error_list, '') + item['_source'] = repair_persian_date(item['_source'], 'expire_date', id, error_list, '') + item['_source'] = repair_persian_date(item['_source'], 'fixed_date', id, error_list, '') + item['_source'] = repair_persian_date(item['_source'], 'renewal_date', id, error_list, '') + + if 'eblagh' in item['_source'] : + item['_source']['eblagh'] = repair_persian_date(item['_source']['eblagh'], 'date', id, error_list, 'eblagh') + if 'rrk' in item['_source'] : + item['_source']['rrk'] = repair_persian_date(item['_source']['rrk'], 'date', id, error_list, 'rrk') + data_new.append(item) + return data_new + + + +def restore_correct_data_to_elastic(elastic, file_path, index_name ) : + error_list = [] + fileNo = 0 + with zipfile.ZipFile(file_path, "r") as zObject: + fileNo += 1 + + packNo = 0 + counter = 0 + for filename in zObject.namelist(): + packNo += 1 + + # print("index:", index_name, "=>", filename) + data = [] + with zObject.open(filename) as file: + data = json.loads(file.read()) + + data_new = correct_qanono_data_json(data, error_list) + elastic.importJsonDataToElastic(data_new, index_name, [], True) + counter += len(data) + # print('-'*10, 'len()', str(counter) + '/ ' + str(len(data)) + ' , ' +str(len(data_new)) ) + + + elastic.es.indices.refresh(index=index_name) + print(elastic.es.cat.count(index=index_name, format="json")) + + file_log_error = 'G:/Project2/160_dotic/date_log_error.txt' + with open(file_log_error, 'w', encoding='utf8') as f : + json.dump(error_list, f, ensure_ascii=False, indent=4) + + + + +def import_data_new_qaqanon(elastic, path_file): + jsonData=[] + count = 0 + id = "" + try: + + try: + list_ = elastic.iterateJsonFile(path_file, True) + except Exception as e: + print("Exception es_iterate_all_documents : " + str(e)) + + print('*' * 20 , ' count=', elastic.total) + + for mentry in list(list_): + count += 1 + entry = mentry["source"] + + id = entry.get("id", "") + main_type = entry.get("main_type", "") + + # قانونها را نباید بروزرسانی کنیم ...چون از طرف مجلس تغییرات شناسانامه در ایندکس داشته است + if(main_type == 'قانون') : + continue + + jsonData.append({ + "_id": id, + "_source": entry + }) + + except Exception as e: + print("Exception: " + str(e)) + + error_list = [] + jsonData_new = correct_qanono_data_json(jsonData, error_list) + + pack_size = 1000 + bulk = [] + total = len(jsonData_new) + count = 0 + for item in jsonData_new: + bulk.append(item) + if len(bulk) >= pack_size : + count += len(bulk) + elastic.importJsonDataToElastic(bulk, "mj_qa_qanon") + print( ' count update ', str(count), '/', str(total)) + bulk = [] + + if len(bulk): + count += len(bulk) + elastic.importJsonDataToElastic(bulk, "mj_qa_qanon") + print( ' count update ', str(count), '/', str(total)) + bulk = [] + + \ No newline at end of file diff --git a/app/temp_codes.py b/app/sample_run_codes.py similarity index 97% rename from app/temp_codes.py rename to app/sample_run_codes.py index a179d6f..1d5bd9c 100644 --- a/app/temp_codes.py +++ b/app/sample_run_codes.py @@ -11,7 +11,7 @@ from app.common.text_normalizer import TextNormalizer from app.common.general_functions import * from app.common.elastic_helper import ElasticHelper from app.for_ai.create_relation_tags import * -from app.temp_refactor_gn_dataset import * +# from app.temp_refactor_gn_dataset import * load_dotenv(dotenv_path="config.env") @@ -48,12 +48,14 @@ path_base_map = "G:/Project2/gateway_php/repo/_other/" elastic = ElasticHelper(host, password, "elastic", path_base_map) +# elastic.backupIndexToZipfile("G:/Project2/160_dotic", "mj_qa_qanon", "mj_qa_qanon_112") + # elastic.removeCustomFileds("mj_qa_section", ["tcode","nlp_parser","content_normal","tcode_mains","tcode_subs", "ners_v1", "level", "code-ai"]) # elastic.backupIndexToZipfile("G:/Project2/111", "mj_qa_section-m1") # elastic.createIndex( index_name='mj_qa_section-m1', app_key='majles', map_name='mj_qa_section') # elastic.restorFileToElastic2('G:/Project2/111/mj_qa_section-m1.zip', 'mj_qa_section-m1', 'majles', False, 'mj_qa_section') -elastic.restorFileToElastic2(path_file='G:/Project2/111/server112/mj_qa_section-m1.zip', index_name='mj_qa_section-m1', app_key='majles', queryDelete=False, map_name='mj_qa_section') +# elastic.restorFileToElastic2(path_file='G:/Project2/111/server112/mj_qa_section-m1.zip', index_name='mj_qa_section-m1', app_key='majles', queryDelete=False, map_name='mj_qa_section') # elastic.backupIndexToZipfile("G:/Project2/111", "mj_plan") # elastic.createIndex( 'mj_plan', 'majles', 'mj_plan') diff --git a/list_LWTopic.json b/list_LWTopic.json new file mode 100644 index 0000000..1a020f0 --- /dev/null +++ b/list_LWTopic.json @@ -0,0 +1 @@ +{"1": {"id": 8183, "title": "\u0645\u062c\u0645\u0648\u0639\u0647 \u0627\u062f\u0627\u0631\u06cc"}, "2": {"id": 8184, "title": "\u0645\u062c\u0645\u0648\u0639\u0647 \u0627\u0633\u0627\u0633\u06cc \u0627\u062c\u062a\u0645\u0627\u0639\u06cc"}, "3": {"id": 8185, "title": "\u0645\u062c\u0645\u0648\u0639\u0647 \u0645\u0627\u0644\u06cc"}, "4": {"id": 8186, "title": "\u0645\u062c\u0645\u0648\u0639\u0647 \u0627\u0642\u062a\u0635\u0627\u062f\u06cc"}, "5": {"id": 8187, "title": "\u0645\u062c\u0645\u0648\u0639\u0647 \u0641\u0631\u0647\u0646\u06af\u06cc"}, "6": {"id": 8188, "title": "\u0645\u062c\u0645\u0648\u0639\u0647 \u06a9\u06cc\u0641\u0631\u06cc"}, "7": {"id": 8189, "title": "\u0645\u062c\u0645\u0648\u0639\u0647 \u0645\u062f\u0646\u06cc"}, "8": {"id": 8190, "title": "\u0634\u0648\u0631\u0627\u0647\u0627\u06cc \u0645\u0631\u062f\u0645\u06cc"}, "9": {"id": 8191, "title": "\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u06a9\u0634\u0648\u0631\u06cc"}, "10": {"id": 8192, "title": "\u0627\u0645\u0648\u0631 \u0628\u06cc\u0646 \u0627\u0644\u0645\u0644\u0644\u06cc"}, "11": {"id": 8193, "title": "\u0633\u0627\u0632\u0645\u0627\u0646\u0647\u0627\u06cc \u062f\u0648\u0644\u062a\u06cc"}, "12": {"id": 8194, "title": "\u0634\u0647\u0631\u062f\u0627\u0631\u06cc"}, "13": {"id": 8195, "title": "\u0648\u06a9\u0627\u0644\u062a"}, "14": {"id": 8196, "title": "\u062f\u0641\u062a\u0631 \u0627\u0633\u0646\u0627\u062f \u0631\u0633\u0645\u06cc"}, "15": {"id": 8197, "title": "\u06a9\u0627\u0631\u0634\u0646\u0627\u0633\u0627\u0646 \u0631\u0633\u0645\u06cc \u0648 \u0645\u062a\u0631\u062c\u0645\u0627\u0646"}, "16": {"id": 8198, "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": 8199, "title": "\u0646\u0638\u0627\u0645 \u067e\u0632\u0634\u06a9\u06cc"}, "18": {"id": 8200, "title": "\u0646\u0638\u0627\u0645 \u0635\u0646\u0641\u06cc"}, "19": {"id": 8201, "title": "\u0646\u0638\u0627\u0645 \u0645\u0647\u0646\u062f\u0633\u06cc \u0633\u0627\u062e\u062a\u0645\u0627\u0646"}, "20": {"id": 8202, "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": 8203, "title": "\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0646\u06cc\u0631\u0648\u0647\u0627\u06cc \u0645\u0633\u0644\u062d"}, "22": {"id": 8204, "title": "\u0627\u0633\u062a\u0627\u0646\u062f\u0627\u0631\u0627\u0646 \u0648 \u0641\u0631\u0645\u0627\u0646\u062f\u0627\u0631\u0627\u0646"}, "23": {"id": 8205, "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": 8206, "title": "\u0627\u0633\u0627\u0633\u06cc"}, "25": {"id": 8207, "title": "\u062a\u0627\u0645\u06cc\u0646 \u0627\u062c\u062a\u0645\u0627\u0639\u06cc"}, "26": {"id": 8208, "title": "\u0627\u0646\u062a\u062e\u0627\u0628\u0627\u062a"}, "27": {"id": 8209, "title": "\u0627\u06cc\u062b\u0627\u0631\u06af\u0631\u0627\u0646"}, "28": {"id": 8210, "title": "\u0627\u0645\u0646\u06cc\u062a . \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0648 \u062f\u0641\u0627\u0639 \u0645\u0644\u06cc"}, "29": {"id": 8211, "title": "\u06a9\u0627\u0631"}, "30": {"id": 8212, "title": "\u0628\u0647\u062f\u0627\u0634\u062a \u0648 \u062f\u0631\u0645\u0627\u0646"}, "31": {"id": 8213, "title": "\u062e\u062f\u0645\u062a \u0648\u0638\u06cc\u0641\u0647 \u0639\u0645\u0648\u0645\u06cc"}, "32": {"id": 8214, "title": "\u062d\u0641\u0627\u0638\u062a \u0645\u062d\u06cc\u0637 \u0632\u06cc\u0633\u062a"}, "33": {"id": 8215, "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": 8216, "title": "\u0627\u0645\u0648\u0631 \u0645\u062c\u0644\u0633 \u0634\u0648\u0631\u0627\u06cc \u0627\u0633\u0644\u0627\u0645\u06cc"}, "35": {"id": 8217, "title": "\u0628\u0648\u062f\u062c\u0647"}, "36": {"id": 8218, "title": "\u0645\u0627\u0644\u06cc\u0627\u062a"}, "37": {"id": 8219, "title": "\u0648\u0627\u0645 \u0648\u06a9\u0645\u06a9 \u0628\u0644\u0627\u0639\u0648\u0636"}, "38": {"id": 8220, "title": "\u0645\u0639\u0627\u0645\u0644\u0627\u062a \u0648 \u0627\u0645\u0648\u0627\u0644 \u062f\u0648\u0644\u062a\u06cc"}, "39": {"id": 8221, "title": "\u0645\u062d\u0627\u0633\u0628\u0627\u062a \u0639\u0645\u0648\u0645\u06cc"}, "40": {"id": 8222, "title": "\u067e\u06cc\u0645\u0627\u0646\u06a9\u0627\u0631\u0627\u0646"}, "41": {"id": 8223, "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": 8224, "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": 8225, "title": "\u062a\u062c\u0627\u0631\u062a"}, "44": {"id": 8226, "title": "\u0631\u0627\u0647 \u0648 \u062a\u0631\u0627\u0628\u0631\u06cc"}, "45": {"id": 8227, "title": "\u0628\u06cc\u0645\u0647"}, "46": {"id": 8228, "title": "\u0635\u0646\u0627\u06cc\u0639"}, "47": {"id": 8229, "title": "\u0628\u0631\u0646\u0627\u0645\u0647 \u0647\u0627\u06cc \u0639\u0645\u0631\u0627\u0646\u06cc"}, "48": {"id": 8230, "title": "\u0645\u0639\u0627\u062f\u0646"}, "49": {"id": 8231, "title": "\u0622\u0628 \u0648 \u0646\u06cc\u0631\u0648"}, "50": {"id": 8232, "title": "\u0646\u0641\u062a \u0648 \u06af\u0627\u0632"}, "51": {"id": 8233, "title": "\u0628\u0627\u0646\u06a9\u06cc \u0648 \u067e\u0648\u0644\u06cc"}, "52": {"id": 8234, "title": "\u0627\u0645\u0648\u0631 \u06af\u0645\u0631\u06a9\u06cc"}, "53": {"id": 8235, "title": "\u067e\u0633\u062a \u0648 \u062a\u0644\u06af\u0631\u0627\u0641 \u0648\u062a\u0644\u0641\u0646"}, "54": {"id": 8236, "title": "\u06a9\u0634\u0627\u0648\u0631\u0632\u06cc \u0648 \u0631\u0648\u0633\u062a\u0627\u06cc\u06cc"}, "55": {"id": 8237, "title": "\u062c\u0646\u06af\u0644\u0647\u0627 \u0648 \u0645\u0631\u0627\u062a\u0639"}, "56": {"id": 8238, "title": "\u0634\u06a9\u0627\u0631 \u0648 \u0635\u06cc\u062f \u0648\u0634\u06cc\u0644\u0627\u062a"}, "57": {"id": 8239, "title": "\u062f\u0631\u06cc\u0627\u06cc\u06cc"}, "58": {"id": 8240, "title": "\u0647\u0648\u0627\u067e\u06cc\u0645\u0627\u06cc\u06cc"}, "59": {"id": 8241, "title": "\u0631\u0627\u0647 \u0622\u0647\u0646"}, "60": {"id": 8242, "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": 8243, "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": 8244, "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": 8245, "title": "\u0648\u0627\u0631\u062f\u0627\u062a \u0648 \u0635\u0627\u062f\u0631\u0627\u062a"}, "64": {"id": 8246, "title": "\u0627\u0645\u0648\u0631 \u062a\u0639\u0627\u0648\u0646\u06cc"}, "65": {"id": 8247, "title": "\u062f\u062e\u0627\u0646\u06cc\u0627\u062a"}, "66": {"id": 8248, "title": "\u062f\u0627\u0645 \u0648 \u0637\u06cc\u0648\u0631"}, "67": {"id": 8249, "title": "\u0633\u0631\u0645\u0627\u06cc\u0647 \u06af\u0630\u0627\u0631\u06cc"}, "68": {"id": 8250, "title": "\u0622\u0645\u0627\u0631 \u0648\u0633\u0631\u0634\u0645\u0627\u0631\u06cc"}, "69": {"id": 8251, "title": "\u0647\u0648\u0627\u0634\u0646\u0627\u0633\u06cc"}, "70": {"id": 8252, "title": "\u0645\u0646\u0627\u0637\u0642 \u0622\u0632\u0627\u062f \u0648\u06cc\u0698\u0647"}, "71": {"id": 8253, "title": "\u0622\u0645\u0648\u0632\u0634 \u0648 \u067e\u0631\u0648\u0631\u0634"}, "72": {"id": 8254, "title": "\u0622\u0645\u0648\u0632\u0634 \u0639\u0627\u0644\u06cc \u0648 \u062a\u062d\u0642\u06cc\u0642\u0627\u062a"}, "73": {"id": 8255, "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": 8256, "title": "\u0641\u0631\u0647\u0646\u06af \u0648 \u0647\u0646\u0631"}, "75": {"id": 8257, "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": 8258, "title": "\u062c\u0631\u0627\u06cc\u0645 \u0648 \u0645\u062c\u0627\u0632\u0627\u062a\u0647\u0627\u06cc \u0639\u0645\u0648\u0645\u06cc"}, "77": {"id": 8259, "title": "\u0622\u06cc\u06cc\u0646 \u062f\u0627\u062f\u0631\u0633\u06cc \u06a9\u06cc\u0641\u0631\u06cc"}, "78": {"id": 8260, "title": "\u062f\u0627\u062f\u0631\u0633\u06cc \u0648 \u06a9\u06cc\u0641\u0631 \u0627\u0631\u062a\u0634"}, "79": {"id": 8261, "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": 8262, "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": 8263, "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": 8264, "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": 8265, "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": 8266, "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": 8267, "title": "\u062a\u0639\u0632\u06cc\u0631\u0627\u062a \u062d\u06a9\u0648\u0645\u062a\u06cc"}, "86": {"id": 8268, "title": "\u0645\u062f\u0646\u06cc"}, "87": {"id": 8269, "title": "\u0622\u06cc\u06cc\u0646 \u062f\u0627\u062f\u0631\u0633\u06cc \u0645\u062f\u0646\u06cc"}, "88": {"id": 8270, "title": "\u0627\u0645\u0648\u0631 \u062d\u0633\u0628\u06cc"}, "89": {"id": 8271, "title": "\u062b\u0628\u062a \u0627\u062d\u0648\u0627\u0644"}, "90": {"id": 8272, "title": "\u062b\u0628\u062a \u0627\u0633\u0646\u0627\u062f \u0648 \u0627\u0645\u0644\u0627\u06a9"}, "91": {"id": 8273, "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": 8274, "title": "\u0631\u0648\u0627\u0628\u0637 \u0645\u0648\u062c\u0631\u0648 \u0645\u0633\u062a\u0627\u062c\u0631"}, "93": {"id": 8275, "title": "\u0627\u062a\u0628\u0627\u0639 \u062e\u0627\u0631\u062c\u0647"}, "94": {"id": 8276, "title": "\u0627\u0648\u0642\u0627\u0641"}, "95": {"id": 8277, "title": "\u06af\u0630\u0631\u0646\u0627\u0645\u0647"}, "96": {"id": 8278, "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": 8279, "title": "\u062c\u0644\u0648\u06af\u06cc\u0631\u06cc \u0627\u0632 \u062a\u0635\u0631\u0641 \u0639\u062f\u0648\u0627\u0646\u06cc"}, "98": {"id": 8280, "title": "\u062d\u0645\u0627\u06cc\u062a \u062e\u0627\u0646\u0648\u0627\u062f\u0647"}, "99": {"id": 8281, "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": 8282, "title": "\u0645\u0633\u06a9\u0646"}, "101": {"id": 8283, "title": "\u0627\u0631\u0627\u0636\u06cc (\u0634\u0647\u0631\u06cc \u0648 \u06a9\u0634\u0627\u0648\u0631\u0632\u06cc )"}, "102": {"id": 8284, "title": "\u062f\u06cc\u0648\u0627\u0646 \u0639\u062f\u0627\u0644\u062a \u0627\u062f\u0627\u0631\u06cc"}, "103": {"id": 8285, "title": "\u062f\u0627\u0648\u0631\u06cc"}, "104": {"id": 8286, "title": "\u0642\u0631\u0627\u0631\u062f\u0627\u062f\u0647\u0627\u06cc \u062f\u0648\u062c\u0627\u0646\u0628\u0647"}, "105": {"id": 8287, "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": 8288, "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": 8289, "title": "\u0645\u0639\u0627\u0647\u062f\u0627\u062a \u0648 \u06a9\u0646\u0648\u0627\u0646\u0633\u06cc\u0648\u0646\u0647\u0627"}, "108": {"id": 8290, "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": 8291, "title": "\u0627\u0645\u0648\u0631 \u0645\u0631\u0632\u06cc"}, "110": {"id": 8292, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0648\u0632\u0627\u0631\u062a \u0622\u0645\u0648\u0632\u0634 \u0648 \u067e\u0631\u0648\u0631\u0634"}, "111": {"id": 8293, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0627\u0637\u0644\u0627\u0639\u0627\u062a"}, "112": {"id": 8294, "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": 8295, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0627\u0645\u0648\u0631 \u062e\u0627\u0631\u062c\u0647"}, "114": {"id": 8296, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0628\u0627\u0632\u0631\u06af\u0627\u0646\u06cc"}, "115": {"id": 8297, "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": 8298, "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": 8299, "title": "\u0648\u0638\u0627\u06cc\u0641 \u062a\u0639\u0627\u0648\u0646"}, "118": {"id": 8300, "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": 8301, "title": "\u0648\u0638\u0627\u06cc\u0641 \u062f\u0627\u062f\u06af\u0633\u062a\u0631\u06cc"}, "120": {"id": 8302, "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": 8303, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0631\u0627\u0647 \u0648 \u062a\u0631\u0627\u0628\u0631\u06cc"}, "122": {"id": 8304, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0635\u0646\u0627\u06cc\u0639 (\u0642\u0628\u0644 \u0627\u0632 \u0627\u062f\u063a\u0627\u0645)"}, "123": {"id": 8305, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0641\u0631\u0647\u0646\u06af \u0648 \u0622\u0645\u0648\u0632\u0634 \u0639\u0627\u0644\u06cc"}, "124": {"id": 8306, "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": 8307, "title": "\u0648\u0638\u0627\u06cc\u0641 \u06a9\u0627\u0631 \u0648 \u0627\u0645\u0648\u0631 \u0627\u062c\u062a\u0645\u0627\u0639\u06cc"}, "126": {"id": 8308, "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": 8309, "title": "\u0648\u0638\u0627\u06cc\u0641 \u06a9\u0634\u0648\u0631"}, "128": {"id": 8310, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0645\u0633\u06a9\u0646 \u0648 \u0634\u0647\u0631\u0633\u0627\u0632\u06cc"}, "129": {"id": 8311, "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": 8312, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0646\u0641\u062a"}, "131": {"id": 8313, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0646\u06cc\u0631\u0648"}, "132": {"id": 8314, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0646\u0647\u0627\u062f \u0631\u06cc\u0627\u0633\u062a \u062c\u0645\u0647\u0648\u0631\u06cc"}, "133": {"id": 8315, "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": 8316, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0633\u0627\u0632\u0645\u0627\u0646 \u0627\u0646\u0631\u0698\u06cc \u0627\u062a\u0645\u06cc"}, "135": {"id": 8317, "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": 8318, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0633\u0627\u0632\u0645\u0627\u0646 \u062a\u0631\u0628\u06cc\u062a \u0628\u062f\u0646\u06cc"}, "137": {"id": 8319, "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": 8320, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0633\u0627\u0632\u0645\u0627\u0646 \u0635\u062f\u0627 \u0648 \u0633\u06cc\u0645\u0627"}, "139": {"id": 8321, "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": 8322, "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": 8323, "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": 8324, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0628\u0627\u0646\u06a9\u0647\u0627 (\u0639\u0644\u0627\u0648\u0647 \u0628\u0631 \u06a9\u062f 409)"}, "143": {"id": 8325, "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": 8326, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0647\u06cc\u0627\u062a \u0648\u0632\u06cc\u0631\u0627\u0646 \u0648 \u062f\u0648\u0644\u062a"}, "145": {"id": 8327, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0641\u0631\u0645\u0627\u0646\u062f\u0647\u06cc \u06a9\u0644 \u0642\u0648\u0627"}, "146": {"id": 8328, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0645\u062c\u0644\u0633 \u062e\u0628\u0631\u06af\u0627\u0646"}, "147": {"id": 8329, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0645\u0642\u0627\u0645 \u0645\u0639\u0638\u0645 \u0631\u0647\u0628\u0631\u06cc"}, "148": {"id": 8330, "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": 8331, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0648\u0632\u0627\u0631\u062a \u062c\u0647\u0627\u062f \u06a9\u0634\u0627\u0648\u0631\u0632\u06cc"}, "150": {"id": 8332, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0635\u0646\u0627\u06cc\u0639 \u0648 \u0645\u0639\u0627\u062f\u0646"}, "151": {"id": 8333, "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": 8334, "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": 8335, "title": "\u06a9\u0645\u06cc\u062a\u0647 \u0627\u0645\u062f\u0627\u062f \u0627\u0645\u0627\u0645 \u062e\u0645\u06cc\u0646\u06cc"}, "154": {"id": 8336, "title": "\u0633\u0627\u0632\u0645\u0627\u0646 \u062a\u0628\u0644\u06cc\u063a\u0627\u062a \u0627\u0633\u0644\u0627\u0645\u06cc"}, "155": {"id": 8337, "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": 8338, "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": 8339, "title": "\u0628\u0646\u06cc\u0627\u062f 15 \u062e\u0631\u062f\u0627\u062f"}, "158": {"id": 8340, "title": "\u0628\u0646\u06cc\u0627\u062f \u0645\u0633\u06a9\u0646 \u0627\u0646\u0642\u0644\u0627\u0628 \u0627\u0633\u0644\u0627\u0645\u06cc"}, "159": {"id": 8341, "title": "\u0634\u0648\u0631\u0627\u06cc \u0639\u0627\u0644\u06cc \u0627\u0646\u0642\u0644\u0627\u0628 \u0641\u0631\u0647\u0646\u06af\u06cc"}, "160": {"id": 8342, "title": "\u062c\u0645\u0639\u06cc\u062a \u0647\u0644\u0627\u0644 \u0627\u062d\u0645\u0631"}, "161": {"id": 8343, "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": 8344, "title": "\u0646\u0647\u0636\u062a \u0633\u0648\u0627\u062f \u0622\u0645\u0648\u0632\u06cc"}, "163": {"id": 8345, "title": "\u062f\u0641\u062a\u0631 \u062a\u0628\u0644\u06cc\u063a\u0627\u062a \u0627\u0633\u0644\u0627\u0645\u06cc \u0642\u0645"}, "164": {"id": 8346, "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": 8347, "title": "\u062c\u0647\u0627\u062f \u062f\u0627\u0646\u0634\u06af\u0627\u0647\u06cc"}, "166": {"id": 8348, "title": "\u062f\u0627\u0646\u0634\u06af\u0627\u0647 \u0634\u0627\u0647\u062f"}, "167": {"id": 8349, "title": "\u06a9\u0645\u06cc\u062a\u0647 \u0645\u0644\u06cc \u0627\u0644\u0645\u067e\u06cc\u06a9 \u0627\u06cc\u0631\u0627\u0646"}, "168": {"id": 8350, "title": "\u0633\u0627\u0632\u0645\u0627\u0646 \u062a\u0627\u0645\u06cc\u0646 \u0627\u062c\u062a\u0645\u0627\u0639\u06cc"}, "169": {"id": 8351, "title": "\u062d\u0648\u0632\u0647 \u0647\u0627\u06cc \u0639\u0644\u0645\u06cc\u0647 (\u0642\u0645 ...)"}, "170": {"id": 8352, "title": "\u0633\u0627\u0632\u0645\u0627\u0646 \u062f\u0647\u06cc\u0627\u0631\u06cc"}, "171": {"id": 8353, "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": 8354, "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": 8355, "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": 8356, "title": "\u0645\u0648\u0633\u0633\u0647 \u062c\u0647\u0627\u062f \u0627\u0633\u062a\u0642\u0644\u0627\u0644"}, "175": {"id": 8357, "title": "\u0645\u0648\u0633\u0633\u0647 \u062c\u0647\u0627\u062f \u062a\u0648\u0633\u0639\u0647"}, "176": {"id": 8358, "title": "\u0645\u0648\u0633\u0633\u0647 \u062c\u0647\u0627\u062f \u0646\u0635\u0631"}, "177": {"id": 8359, "title": "\u0628\u0646\u06cc\u0627\u062f \u0627\u0645\u0648\u0631 \u0628\u06cc\u0645\u0627\u0631\u06cc\u0647\u0627\u06cc \u062e\u0627\u0635"}, "178": {"id": 8360, "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": 8361, "title": "\u0628\u0646\u06cc\u0627\u062f \u0641\u0631\u0647\u0646\u06af\u06cc \u0648 \u0647\u0646\u0631\u06cc \u0631\u0648\u062f\u06a9\u06cc"}, "180": {"id": 8362, "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": 8363, "title": "\u0633\u0627\u0632\u0645\u0627\u0646 \u0628\u0648\u0631\u0633"}, "182": {"id": 8364, "title": "\u0633\u0627\u0632\u0645\u0627\u0646 \u062f\u0627\u0646\u0634 \u0622\u0645\u0648\u0632\u06cc \u062c.\u0627.\u0627"}, "183": {"id": 8365, "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": 8366, "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": 8367, "title": "\u0627\u062a\u0648\u0645\u0628\u06cc\u0644\u0647\u0627\u06cc \u062f\u0648\u0644\u062a\u06cc"}, "186": {"id": 8368, "title": "\u0639\u0648\u0627\u0631\u0636 \u063a\u06cc\u0631 \u062f\u0648\u0644\u062a\u06cc"}, "187": {"id": 8369, "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": 8370, "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": 8371, "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": 8372, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0635\u0646\u0639\u062a \u060c \u0645\u0639\u062f\u0646 \u0648 \u062a\u062c\u0627\u0631\u062a"}, "192": {"id": 8373, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0648\u0632\u0627\u0631\u062a \u0648\u0631\u0632\u0634 \u0648 \u062c\u0648\u0627\u0646\u0627\u0646"}, "193": {"id": 8374, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0648\u0632\u0627\u0631\u062a \u0631\u0627\u0647 \u0648 \u0634\u0647\u0631\u0633\u0627\u0632\u06cc"}, "194": {"id": 8375, "title": "\u0635\u0646\u062f\u0648\u0642 \u0636\u0645\u0627\u0646\u062a \u0633\u067e\u0631\u062f\u0647 \u0647\u0627"}, "214": {"id": 8376, "title": "\u0648\u0638\u0627\u06cc\u0641 \u0642\u0648\u0647 \u0642\u0636\u0627\u06cc\u06cc\u0647"}, "234": {"id": 8377, "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": 8378, "title": "\u0627\u0645\u0648\u0631 \u0632\u0646\u0627\u0646"}, "255": {"id": 8379, "title": "\u062a\u062d\u0648\u0644\u0627\u062a \u0645\u0631\u0627\u062c\u0639 \u0648\u0636\u0639"}, "256": {"id": 8380, "title": "\u0646\u0641\u062a"}, "257": {"id": 8381, "title": "\u06af\u0627\u0632"}, "258": {"id": 8382, "title": "\u067e\u062a\u0631\u0648\u0634\u06cc\u0645\u06cc"}, "276": {"id": 8383, "title": "\u0622\u0628"}, "277": {"id": 8384, "title": "\u0628\u0631\u0642"}, "278": {"id": 8385, "title": "\u0627\u0646\u0631\u0698\u06cc \u0647\u0633\u062a\u0647 \u0627\u06cc"}, "279": {"id": 8386, "title": "\u0633\u0627\u06cc\u0631 \u0627\u0646\u0631\u0698\u06cc \u0647\u0627"}, "316": {"id": 8387, "title": "\u0648\u0631\u0632\u0634"}, "349": {"id": 8388, "title": "\u0627\u0645\u0648\u0631 \u06a9\u0634\u0627\u0648\u0631\u0632\u06cc"}, "350": {"id": 8389, "title": "\u0627\u0645\u0648\u0631 \u0631\u0648\u0633\u062a\u0627\u0647\u0627"}, "351": {"id": 8390, "title": "\u0627\u0645\u0648\u0631 \u0639\u0634\u0627\u06cc\u0631"}, "352": {"id": 8391, "title": "\u0635\u0646\u0627\u06cc\u0639 \u0631\u0648\u0633\u062a\u0627\u06cc\u06cc"}, "353": {"id": 8392, "title": "\u0635\u0646\u0627\u06cc\u0639"}, "354": {"id": 8393, "title": "\u0635\u0646\u0627\u06cc\u0639 \u062f\u0633\u062a\u06cc"}, "355": {"id": 8394, "title": "\u0635\u0646\u0627\u06cc\u0639 \u0631\u0648\u0633\u062a\u0627\u06cc\u06cc"}, "356": {"id": 8395, "title": "\u0635\u0646\u0627\u06cc\u0639 \u06a9\u0648\u0686\u06a9"}, "357": {"id": 8396, "title": "\u0634\u0647\u0631\u06a9\u0647\u0627\u06cc \u0635\u0646\u0639\u062a\u06cc"}, "358": {"id": 8397, "title": "\u0646\u0648\u0627\u062d\u06cc \u0635\u0646\u0639\u062a\u06cc"}, "359": {"id": 8398, "title": "\u0627\u0633\u062a\u0627\u0646\u062f\u0627\u0631\u062f"}, "360": {"id": 8399, "title": "\u0627\u0645\u0648\u0631 \u0641\u0631\u0647\u0646\u06af\u06cc"}, "361": {"id": 8400, "title": "\u0627\u0645\u0648\u0631 \u0647\u0646\u0631\u06cc"}, "362": {"id": 8401, "title": "\u0645\u06cc\u0631\u0627\u062b \u0641\u0631\u0647\u0646\u06af\u06cc"}, "363": {"id": 8402, "title": "\u0627\u0639\u0637\u0627\u06cc \u0646\u0634\u0627\u0646 \u0647\u0627\u06cc \u062f\u0648\u0644\u062a\u06cc"}, "364": {"id": 8403, "title": "\u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0647\u0627"}, "368": {"id": 8404, "title": "\u0645\u0637\u0628\u0648\u0639\u0627\u062a \u0648 \u0646\u0634\u0631\u06cc\u0627\u062a"}, "369": {"id": 8405, "title": "\u062e\u0628\u0631\u06af\u0632\u0627\u0631\u06cc \u0647\u0627"}, "370": {"id": 8406, "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": 8407, "title": "\u0627\u06cc\u0646\u062a\u0631\u0646\u062a \u0648 \u0641\u0636\u0627\u06cc \u0645\u062c\u0627\u0632\u06cc"}, "372": {"id": 8408, "title": "\u0622\u0645\u0648\u0632\u0634 \u0639\u0627\u0644\u06cc"}, "373": {"id": 8409, "title": "\u062a\u062d\u0642\u06cc\u0642\u0627\u062a"}, "374": {"id": 8410, "title": "\u0646\u062e\u0628\u06af\u0627\u0646 \u0648 \u062f\u0627\u0646\u0634\u0645\u0646\u062f\u0627\u0646"}, "375": {"id": 8411, "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": 8412, "title": "\u062a\u0642\u0633\u06cc\u0645\u0627\u062a \u06a9\u0634\u0648\u0631\u06cc"}, "377": {"id": 8413, "title": "\u0627\u0633\u062a\u0627\u0646\u062f\u0627\u0631\u0627\u0646"}, "378": {"id": 8414, "title": "\u0641\u0631\u0645\u0627\u0646\u062f\u0627\u0631\u0627\u0646"}, "379": {"id": 8415, "title": "\u0628\u062e\u0634\u062f\u0627\u0631\u0627\u0646"}, "380": {"id": 8416, "title": "\u062f\u0647\u06cc\u0627\u0631\u0627\u0646"}, "381": {"id": 8417, "title": "\u06af\u0631\u062f\u0634\u06af\u0631\u06cc"}, "382": {"id": 8418, "title": "\u0641\u0631\u0647\u0646\u06af\u0633\u062a\u0627\u0646 \u0647\u0627"}, "385": {"id": 8419, "title": "\u06a9\u0633\u0628 \u0648 \u06a9\u0627\u0631"}} \ No newline at end of file