def main(): for sentence in read_parse_txt(): connect_word = '' for index, word in enumerate(sentence): if word['pos'] == '名詞': connect_word += word['surface'] else: if connect_word != '': print(connect_word) connect_word = ''
def main(): for sentence in read_parse_txt(): for word in sentence: if word['pos'] == '動詞': print(word['base'])
def main(): for sentence in read_parse_txt(): for index,word in enumerate(sentence): if word['pos'] == '名詞' and sentence[index+1]['surface'] == 'の' and sentence[index+2]['pos'] == '名詞': print(word['surface'] +sentence[index+1]['surface'] + sentence[index+2]['surface'])
def main(): for sentence in read_parse_txt(): for word in sentence: if word['pos'] == '名詞' and word['pos1'] == 'サ変接続': print(word['surface'])