def main(): text = neko.read_and_map() frequency_list = neko.frequency_list(text) frequencies = [freq for word, freq in frequency_list] x = [i for i in range(len(frequencies))] plt.plot(x, frequencies) plt.xscale('log') plt.yscale('log') plt.show() return
def main(): text = neko.read_and_map() frequency_list = neko.frequency_list(text) hist = sorted(neko.histogram(frequency_list).items()) # 全部出すと見えないので上位10件 hist = hist[:10] x = [x for x, y in hist] y = [y for x, y in hist] plt.bar(x, y) plt.show() return
def main(): text = neko.read_and_map() result = neko.frequency_list(text) top10 = result[:10] top10_freqs = [x[1] for x in top10] top10_surfaces = [x[0][0] for x in top10] print(top10_freqs) x = range(10) y = top10_freqs plt.bar(x, y, align="center") plt.xticks(x, top10_surfaces, fontproperties=fp) plt.show() return
def main(): text = neko.read_and_map() result = neko.frequency_list(text) print(result) return