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

言語処理100本ノック

35. 名詞の連接 名詞の連接(連続して出現する名詞)を最長一致で抽出せよ 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…