Esempio n. 1
0
def fact_evi_main():
    """
	test every def in fact_and_evidence.py
	:return: <int> 0
	"""
    with tools.ExcelContext(EXCEL_TAG) as ec:

        for paper_dict in paper_dict_generator(PAPER_DICT_KEYS):

            if len(paper_dict) == 1:
                continue

            paper_id = paper_dict['paper_id']
            paper_argu = paper_dict.get('argu', constant.ENDURE_ERROR)
            paper_fact = paper_dict.get('fact', constant.ENDURE_ERROR)
            paper_opinion = paper_dict.get('opinion', constant.ENDURE_ERROR)

            # sum_facts_dict = get_sum_facts_dict(paper_argu, paper_opinion + paper_fact)

            # 输出至excel
            if ec.excel_tag:
                output_to_excel(
                    ec.active_sheet,
                    paper_id,
                    # sum_total_p=sum_facts_dict.get('sum_total_p', constant.ENDURE_ERROR),
                    # sum_total_c=sum_facts_dict.get('sum_total_c', constant.ENDURE_ERROR),
                    # tag_sum_same=sum_facts_dict.get('tag_sum_same', constant.ENDURE_ERROR),
                    # facts_num_p=sum_facts_dict.get('facts_num_p', constant.ENDURE_ERROR),
                    # facts_num_c=sum_facts_dict.get('facts_num_c', constant.ENDURE_ERROR),
                    # tag_facts_same=sum_facts_dict.get('tag_facts_same', constant.ENDURE_ERROR),
                )

    return 0
def intro_info_main():
    """
	test every def in intro_info.py
	:return: <int> 0
	"""
    with tools.ExcelContext(EXCEL_TAG) as ec:

        for paper_dict in paper_dict_generator(PAPER_DICT_KEYS):

            if len(paper_dict) == 1:
                continue

            paper_id = paper_dict['paper_id']
            paper_head = paper_dict.get('head', constant.ENDURE_ERROR)
            paper_intro = paper_dict.get('intro', constant.ENDURE_ERROR)
            paper_judges_info = paper_dict.get('judges_info',
                                               constant.ENDURE_ERROR)

            # court_info = get_court_info(paper_head)
            # tag_simple_procedure = get_tag_simple_procedure(paper_intro)
            # tag_designate = get_tag_designate(paper_intro)
            # tag_delay = get_tag_delay(paper_intro)
            # tag_investi_plus = get_tag_investi_plus(paper_intro)
            # judges_info_dict = get_judges_info(paper_judges_info)
            # gongsu_infos = get_gongsu_infos(paper_intro)

            # 输出至excel
            if ec.excel_tag:
                output_to_excel(
                    ec.active_sheet,
                    paper_id,
                    # court_name=court_info.get('court_name', constant.ENDURE_ERROR),
                    # court_grade=court_info.get('court_grade', constant.ENDURE_ERROR),
                    # court_location=court_info.get('court_location', constant.ENDURE_ERROR),
                    # court_location_label=court_info.get('court_location_label', constant.ENDURE_ERROR),
                    # tag_simple_procedure=tag_simple_procedure,
                    # tag_designate=tag_designate,
                    # tag_delay=tag_delay,
                    # tag_investi_plus=tag_investi_plus,
                    # chief_judge_name=judges_info_dict.get('chief_judge_name', constant.ENDURE_ERROR),
                    # judge_names=judges_info_dict.get('judge_names', constant.ENDURE_ERROR),
                    # judge_time=judges_info_dict.get('judge_time', constant.ENDURE_ERROR),
                    # tag_juror=judges_info_dict.get('tag_juror', constant.ENDURE_ERROR),
                    # procuratorate_name=gongsu_infos.get('procuratorate_name', constant.ENDURE_ERROR),
                    # prosecute_time=gongsu_infos.get('prosecute_time', constant.ENDURE_ERROR),
                    # crime_p=gongsu_infos.get('crime_p', constant.ENDURE_ERROR),
                    # tag_change_sue=gongsu_infos.get('tag_change_sue', constant.ENDURE_ERROR),
                )

    return 0
Esempio n. 3
0
def penalty_main():
	"""
	test every def in penalty.py
	:return: <int> 0
	"""
	with tools.ExcelContext(EXCEL_TAG) as ec:

		for paper_dict in paper_dict_generator(PAPER_DICT_KEYS):

			if len(paper_dict) == 1:
				continue

			paper_id = paper_dict['paper_id']
			# paper_opinion = paper_dict.get('opinion', constant.ENDURE_ERROR)
			# paper_judge = paper_dict.get('judge', constant.ENDURE_ERROR)
			#
			# punish_infos = get_punish_infos(paper_judge)
			# punish_factors = get_punish_factors(paper_opinion)

			# 输出至excel
			if ec.excel_tag:
				output_to_excel(
					ec.active_sheet,
					paper_id,
					# crime_c=punish_infos.get('crime_c', constant.ENDURE_ERROR),
					# tag_crimes=punish_infos.get('tag_crimes', constant.ENDURE_ERROR),
					# mianyu=punish_infos.get('mianyu', constant.ENDURE_ERROR),
					# juyi=punish_infos.get('juyi', constant.ENDURE_ERROR),
					# tag_guanzhi=punish_infos.get('tag_guanzhi', constant.ENDURE_ERROR),
					# tuxing=punish_infos.get('tuxing', constant.ENDURE_ERROR),
					# sixing=punish_infos.get('sixing', constant.ENDURE_ERROR),
					# fajin=punish_infos.get('fajin', constant.ENDURE_ERROR),
					# moshou=punish_infos.get('moshou', constant.ENDURE_ERROR),
					# boduo=punish_infos.get('boduo', constant.ENDURE_ERROR),
					# huanxing=punish_infos.get('huanxing', constant.ENDURE_ERROR),
					# tag_zishou=punish_factors.get('tag_zishou', constant.ENDURE_ERROR),
					# tag_ligong=punish_factors.get('tag_ligong', constant.ENDURE_ERROR),
					# tag_tanbai=punish_factors.get('tag_tanbai', constant.ENDURE_ERROR),
					# gongfan=punish_factors.get('gongfan', constant.ENDURE_ERROR),
					# tag_suohui=punish_factors.get('tag_suohui', constant.ENDURE_ERROR),
					# tag_tuizang=punish_factors.get('tag_tuizang', constant.ENDURE_ERROR),
					# tag_bad_effects=punish_factors.get('tag_bad_effects', constant.ENDURE_ERROR),
				)

	return 0
def defendant_info_main():
    """
	test every def in defendant_info.py
	:return: <int> 0
	"""
    with tools.ExcelContext(EXCEL_TAG) as ec:

        for paper_dict in paper_dict_generator(PAPER_DICT_KEYS):

            if len(paper_dict) == 1:
                continue

            paper_id = paper_dict['paper_id']
            paper_intro = paper_dict.get('intro', constant.ENDURE_ERROR)
            paper_argu = paper_dict.get('argu', constant.ENDURE_ERROR)
            paper_fact = paper_dict.get('fact', constant.ENDURE_ERROR)
            d_sentence = get_d_sentence(paper_intro)
            argu_and_fact = paper_argu + paper_fact

            # defendant_infos = get_defendant_infos(d_sentence)
            # job_infos = get_job_infos(paper_intro, argu_and_fact)
            # lawyer_infos = get_lawyer_infos(paper_intro)

            # 输出至excel
            if ec.excel_tag:
                output_to_excel(
                    ec.active_sheet,
                    paper_id,
                    # defendant_name=defendant_infos.get('d_name', constant.ENDURE_ERROR),
                    # defendant_family_name=defendant_infos.get('d_family_name', constant.ENDURE_ERROR),
                    # defendant_sex=defendant_infos.get('d_sex', constant.ENDURE_ERROR),
                    # defendant_volk=defendant_infos.get('d_volk', constant.ENDURE_ERROR),
                    # defendant_birthday=defendant_infos.get('d_birthday', constant.ENDURE_ERROR),
                    # defendant_place_registered=defendant_infos.get('d_place_registered', constant.ENDURE_ERROR),
                    # defendant_place_current=defendant_infos.get('d_place_current', constant.ENDURE_ERROR),
                    # job_name=job_infos.get('job_name', constant.ENDURE_ERROR),
                    # job_domain=job_infos.get('job_domain', constant.ENDURE_ERROR),
                    # job_grade=job_infos.get('job_grade', constant.ENDURE_ERROR),
                    # lawyer_name=lawyer_infos.get('lawyer_name', constant.ENDURE_ERROR),
                    # law_firm_name=lawyer_infos.get('law_firm_name', constant.ENDURE_ERROR),
                )

    return 0
def pre_extract_main():
	"""
	test every def in pre_extract.py
	:return: <int> 0
	"""
	with tools.ExcelContext(EXCEL_TAG) as ec:
		for paper_id, paper_path, paper in tools.paper_iterator():
			# paper_mark = get_paper_mark(paper)
			# paper_dict = paper_divider(paper_id, paper)
			# trial_level = get_trial_level(paper_mark, paper_dict.get('intro', constant.ENDURE_ERROR))
			pass

			# 输出至excel
			if ec.excel_tag:
				output_to_excel(
					ec.active_sheet,
					paper_id,
					# paper_mark=paper_mark,
					# trial_level=trial_level
				)

	return 0