fp_out = open(out_path, 'w', encoding='utf-8')
with open(in_path, 'r', encoding='utf-8') as fp:
for i, txt in enumerate(fp.readlines()):
if i > 10:
break
txt_list = txt.split('。')
txt_list_new = list(filter(lambda x: re.sub(r'[()\[\]()【】{},,.。!!??]', '', x.strip()) != '', txt_list))
for txt_new in txt_list_new:
if txt_new.strip():
fp_out.write(txt_new.strip() + '。' + '\n')
fp_out.write('\n')
fp_out.close()
04-11
1万+

07-23
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交