fdist1=FreqDist(text1)#计算text1中的词频
vocabulary=fdist1.keys()#关键字信息
fdist1['whale']#‘whale’词出现的频率
fdist1.plot(50,cumulative=True)#词频前50的词汇进行绘图
V = set(text1)#text1 输出词汇集合中词长超过15的词汇
long_words=[w for w in V if len(w) > 15]
text4.collocations()#搭配频繁出现的双连词
[len(w) for w in text1]#text1中每个词的词长
fdist=FreqDist([len(w) for w in text1])#每个词长对应出现的频率
fdist#词长只有20种
fdist.max()#出现频率最高的词长
fdist.freq(3)#给定样本的频率,占全部词汇的百分比