起源:
因看到一篇满眼是字的文章,故希望能够快速的检索出关键字,所以尝试用Python3来实现。
代码
import jieba
import numpy
import codecs
import pandas
import matplotlib.pyplot as plt
from wordcloud import WordCloud
file = codecs.open(r"ljs.txt")
content = file.read()
file.close()
segment=[]
segs=jieba.cut(content)
for seg in segs:
if len(seg) > 1 and seg != '\r\n'