This commit is contained in:
2026-01-28 17:01:19 +08:00
commit 5932629885
24 changed files with 2454 additions and 0 deletions

20
stuctor/tools.py Normal file
View File

@@ -0,0 +1,20 @@
from typing import List
def normal_parse_content(paras: List[str], split_str = '通过仿真'):
content_list = []
front = []
rear = []
flag = True
for para in paras:
if flag:
split_para = para.rsplit(split_str, maxsplit = 1)
if len(split_para) > 1:
flag = False
front.append(split_para[0].strip(";.。,, ") + '查看')
rear.append(*split_para[1:])
else:
front.append(split_para[0])
else:
rear.append(para)
content_list.append({'content': ''.join(front), 'yuqi': ''.join(rear).strip(";.。,, ")})
return content_list