摘要:
import jieba ls="中国是一个伟大的国家,是一个好的国家" print('原始文档为:',ls) counts={} # 定义统计字典 words=jieba.lcut(ls) print('分好的词组为:',words) for word in words: counts[word]=counts.get(word,0)+1 print('生成的字典为:',counts) prin 阅读全文
posted @ 2019-08-30 11:07
Andhui
阅读(2172)
评论(0)
推荐(0)