Files
CTTools0.2Plus/stuctor/tools.py
2026-01-28 17:01:19 +08:00

21 lines
683 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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