예제 #1
0
import p30
import p31

lst = p30.read_mecab()
ans = []

res = p31.search(lst, 'pos', '動詞', 'base')
print(res)
예제 #2
0
파일: p36.py 프로젝트: 9rq/knock100_NLP
def main():
    lst = p30.read_mecab()
    lst = p35.get_word_frequency(lst)
    lst = lst[:show_count]
    labels, count = zip(*lst)
    plot(count, labels, 10)
예제 #3
0
파일: p35.py 프로젝트: prasath1105/nlp100
# -*- coding: utf-8 -*-
# 35
import p30
filepath = 'neko_mecab.txt'


def get_repeated_noun(text):
    longest = []
    current = []
    for line in text:
        for word in line:
            if word['pos'] == '名詞':
                current.append(word['surface'])
            else:
                if len(current) > len(longest):
                    longest = current
                current = []
    return longest


text = p30.read_mecab(filepath)
print get_repeated_noun(text)
예제 #4
0
파일: p35.py 프로젝트: 9rq/knock100_NLP
def main():
    lst = p30.read_mecab()
    ans = get_word_frequency(lst)

    print(ans)