def main(): fin = open("/Users/moguranosenshi/WorkSpace/100knock2015/kajiwara/data/neko.txt.mecab", "r") morph_lists = mogura.get_morphs(fin) fin.close() verbs = get_verbs(morph_lists) print len(verbs) print ", ".join(verbs[:10])
def main(): fin = open("/Users/moguranosenshi/WorkSpace/100knock2015/kajiwara/data/neko.txt.mecab", "r") morph_lists = mogura.get_morphs(fin) fin.close() compound_nouns = get_compound_nouns(morph_lists) for compound_noun in compound_nouns: print compound_noun
def main(): fin = open("/Users/moguranosenshi/WorkSpace/100knock2015/kajiwara/data/neko.txt.mecab", "r") morph_lists = mogura.get_morphs(fin) fin.close() word2freq = word_count(morph_lists) for word, freq in sorted(word2freq.items(), key=lambda x: x[1], reverse=True): print str(freq) + "\t" + word
def main(): fin = open("/Users/moguranosenshi/WorkSpace/100knock2015/kajiwara/data/neko.txt.mecab", "r") morph_lists = mogura.get_morphs(fin) fin.close() word2freq = mogu_count.word_count(morph_lists) x, y = count_number_of_difference(word2freq) plot.bar(x[:30], y[:30]) plot.show()
def main(): fin = open("/Users/moguranosenshi/WorkSpace/100knock2015/kajiwara/data/neko.txt.mecab", "r") morph_lists = mogura.get_morphs(fin) fin.close() tri_grams = get_tri_gram(morph_lists) noun_phrases = get_noun_phrases(tri_grams) for noun_phrase in noun_phrases[:5]: print noun_phrase
def main(): fin = open( "/Users/moguranosenshi/WorkSpace/100knock2015/kajiwara/data/neko.txt.mecab", "r") morph_lists = mogura.get_morphs(fin) fin.close() verbs = get_verbs(morph_lists) print len(verbs) print ", ".join(verbs[:10])
def main(): fin = open("/Users/moguranosenshi/WorkSpace/100knock2015/kajiwara/data/neko.txt.mecab", "r") morph_lists = mogura.get_morphs(fin) fin.close() word2freq = mogu_count.word_count(morph_lists) plot.plot(range(len(word2freq.keys())), [freq for word, freq in sorted(word2freq.items(), key=lambda x: x[1], reverse=True)]) plot.xscale("log") plot.yscale("log") plot.show()
def main(): num = 10 fin = open("/Users/moguranosenshi/WorkSpace/100knock2015/kajiwara/data/neko.txt.mecab", "r") morph_lists = mogura.get_morphs(fin) fin.close() word2freq = mogu_count.word_count(morph_lists) plot.bar(range(1, num+1), [freq for word, freq in sorted(word2freq.items(), key=lambda x: x[1], reverse=True)][:num], align="center") plot.xticks(range(1, num+1), [word.decode("utf-8") for word, freq in sorted(word2freq.items(), key=lambda x: x[1], reverse=True)][:num]) plot.show()
def main(): fin = open( "/Users/moguranosenshi/WorkSpace/100knock2015/kajiwara/data/neko.txt.mecab", "r") morph_lists = mogura.get_morphs(fin) fin.close() compound_nouns = get_compound_nouns(morph_lists) for compound_noun in compound_nouns: print compound_noun
def main(): fin = open( "/Users/moguranosenshi/WorkSpace/100knock2015/kajiwara/data/neko.txt.mecab", "r") morph_lists = mogura.get_morphs(fin) fin.close() word2freq = mogu_count.word_count(morph_lists) x, y = count_number_of_difference(word2freq) plot.bar(x[:30], y[:30]) plot.show()
def main(): fin = open( "/Users/moguranosenshi/WorkSpace/100knock2015/kajiwara/data/neko.txt.mecab", "r") morph_lists = mogura.get_morphs(fin) fin.close() word2freq = word_count(morph_lists) for word, freq in sorted(word2freq.items(), key=lambda x: x[1], reverse=True): print str(freq) + "\t" + word
def main(): fin = open( "/Users/moguranosenshi/WorkSpace/100knock2015/kajiwara/data/neko.txt.mecab", "r") morph_lists = mogura.get_morphs(fin) fin.close() word2freq = mogu_count.word_count(morph_lists) plot.plot(range(len(word2freq.keys())), [ freq for word, freq in sorted( word2freq.items(), key=lambda x: x[1], reverse=True) ]) plot.xscale("log") plot.yscale("log") plot.show()
def main(): num = 10 fin = open( "/Users/moguranosenshi/WorkSpace/100knock2015/kajiwara/data/neko.txt.mecab", "r") morph_lists = mogura.get_morphs(fin) fin.close() word2freq = mogu_count.word_count(morph_lists) plot.bar(range(1, num + 1), [ freq for word, freq in sorted( word2freq.items(), key=lambda x: x[1], reverse=True) ][:num], align="center") plot.xticks(range(1, num + 1), [ word.decode("utf-8") for word, freq in sorted( word2freq.items(), key=lambda x: x[1], reverse=True) ][:num]) plot.show()