唯物是真 @Scaled_Wurm

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

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

import unicodedata

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