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

言語処理100本ノック

31. 動詞 動詞の表層形をすべて抽出せよ. import re sentences = [] with open("D:\\nlp100\\neko.txt.mecab",encoding="UTF-8") as fr: line = fr.readline() keitaiso = [] while line: if "EOS" in line: if len(keitaiso)>0: sentences.append(keitaiso…