首页 > TAG信息列表 > 聊斋志异
jieba分词——聊斋志异
代码: import jiebaprint("====学号:202031013040====")txt=open("聊斋志异.txt","r",encoding="gb18030")words=jieba.lcut(txt.read())counts={} for word in words: if len (word)==1: continue else: counts[word]=c聊斋志异
import jieba txt = open("聊斋志异白话简写版.txt", "r", encoding='utf-8').read() words = jieba.lcut(txt) counts = {} for word in words: if len(word) == 1: continue elif word == "小倩" or word == &尾号07 聊斋志异