唯物是真 @Scaled_Wurm

プログラミング(主にPython2.7)とか機械学習とか

2011-06-20から1日間の記事一覧

テキスト中の漢字の数を調べる

import unicodedata def countKanji(text): s = 0 for c in text: if (unicodedata.name(c)[0:3]) == 'CJK': s += 1 return s

Ubuntu 9.10 でmecabのユーザー辞書を作成したときのメモ

mecab-dict-indexと辞書の場所がなかなかわからなかったのでメモ. /usr/lib/mecab/mecab-dict-index /usr/share/mecab/dic/ipadic /usr/lib/mecab/mecab-dict-index -d /usr/share/mecab/dic/ipadic -u user.dic -f utf-8 -t utf-8 user.csv