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

言語処理100本ノック

32. 動詞の原形 動詞の原形をすべて抽出せよ. 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(keit…