12. for i in range(0,len(lines)):
node = mecab.parseToNode(lines[i])
# 品詞に分解して、助詞や接続詞などは除外している。
while node:
word_type = node.feature.split(",")[0]
if word_type in ["名詞","形容詞","副詞","動詞"]:
if not node.surface in stoplist and not node.surface.isdigit():
output.append(node.surface.upper())
node = node.next
print(output)
12
歌詞を単語にわける(形態素解析)
品詞に分解
For文で曲数分回す