예제 #1
0
파일: wordcount.py 프로젝트: 5470x3/atango
 def count(self, text):
     if isinstance(text, list):
         text = "\n".join(text)
     text = self.prepare_for_counting(text)
     if text:
         return mecab.count_doc(text)
     else:
         return Counter()
예제 #2
0
파일: test_mecab.py 프로젝트: 5470x3/atango
def test_count_doc():
    got = mecab.count_doc('環境\n音楽'.splitlines())
    assert_equals(got, {u'環境': 1, u'音楽': 1})
예제 #3
0
def test_count_doc():
    got = mecab.count_doc('環境\n音楽'.splitlines())
    assert got == {u'環境': 1, u'音楽': 1}