def print2file(f, title, responses, marker = '', separater = True):
if marker != '':
f.write(marker + ' ')
title_cutted = jieba.cut(title.strip(), cut_all=False)
for word in title_cutted:
f.write(word + ' ')
f.write('\n')
for response in responses:
#print(response['Content'])
#if response['Content'] not in count_response.keys():
# count_response[response['Content']] = 0
#count_response[response['Content']] += 1
if marker != '':
f.write(marker + ' ')
response_cutted = jieba.cut(response['Content'].strip(), cut_all=False)
for word in response_cutted:
f.write(word + ' ')
f.write('\n')
if separater:
f.write('===\n')
评论列表
文章目录