根据逗号或者句号拆分文章,匹配长度少于800,最近接800字符并找到逗号或者句号的位置截断
import re
def chaifen(ss,count):
return re.findall(r'.{0,%d}[。,,]'%(count),ss,re.S)
根据逗号或者句号拆分文章,匹配长度少于800,最近接800字符并找到逗号或者句号的位置截断
import re
def chaifen(ss,count):
return re.findall(r'.{0,%d}[。,,]'%(count),ss,re.S)