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

言語処理100本ノック

33. サ変名詞 サ変接続の名詞をすべて抽出せよ. 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(ke…