示例#1
0
文件: 39.py 项目: tkyf/nlp100
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
示例#2
0
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
示例#3
0
文件: 38.py 项目: tkyf/nlp100
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
示例#4
0
文件: 38.py 项目: tkyf/nlp100
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
示例#5
0
文件: 37.py 项目: tkyf/nlp100
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
示例#6
0
文件: 36.py 项目: tkyf/nlp100
def main():
    text = neko.read_and_map()
    result = neko.frequency_list(text)
    print(result)

    return
示例#7
0
文件: 36.py 项目: tkyf/nlp100
def main():
    text = neko.read_and_map()
    result = neko.frequency_list(text)
    print(result)

    return