Skip to content

Commit

Permalink
解決附錄法條只有寫第幾條的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Josiriser committed Aug 12, 2020
1 parent 4f0ba3a commit 4e40aa1
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 10 additions & 1 deletion VerdictCut/find_laws.py
Original file line number Diff line number Diff line change
@@ -12,16 +12,25 @@ def find_laws(judgement, break_line='\r\n'):
judgement, appendix_law_list, table_list)
law_paragraph_list = law_paragraph.split(break_line)
laws_list = []
for data_text in (law_paragraph_list):
last_law_flag=""
for data_text in (law_paragraph_list):
for law in all_laws_list:
if law in data_text:
last_law_flag=law
# print(key,regex_law(law,data_text))
processed_law = clean_data(
regex_law(law, data_text), break_line)
if processed_law in laws_list:
continue
else:
laws_list.append(processed_law)
elif last_law_flag!="" and re.search("^第\s*\d*\s*條",data_text)!=None:
processed_law = clean_data(
regex_law(last_law_flag, last_law_flag+data_text), break_line)
if processed_law in laws_list:
continue
else:
laws_list.append(processed_law)
# 如果中華民國刑法已經找到,就刪除刑法的部分
# 保留含有細項的法條
laws_list_copy = laws_list.copy()
1 change: 0 additions & 1 deletion VerdictCut/tool/find_name_law.py
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@ def find_name_and_law(judgement, break_line='\r\n'):
people_dict = find_roles(judgement, target_roles=[
'被告'], break_line=break_line)
name_list = find_name(people_dict)

# 找執掌法條
all_laws_list = get_all_laws_list()
# 從論罪科刑裡面找法條

0 comments on commit 4e40aa1

Please sign in to comment.