欢迎来到RankFan的Blogs

扩大
缩小

str 的一些处理

  • 去除字符串中的\n
content = handle_text(page_content).replace('\n', '')
  • 断句(正则表达式)
pattern = r"[。!?!?\n]" # 中英文 !?正则表达式
text_list = re.split(pattern, content)

blog:随机生成 str

posted on 2022-02-08 10:32  RankFan  阅读(36)  评论(0)    收藏  举报

导航