2016-12-30から1日間の記事一覧

言語処理100本ノック

36. 単語の出現頻度 文章中に出現する単語とその出現頻度を求め,出現頻度の高い順に並べよ. import re from collections import Counter sentences = [] with open("D:\\nlp100\\neko.txt.mecab",encoding="UTF-8") as fr: line = fr.readline() keitaiso …