一番使われている文字を探す
どの文字の出現頻度が高いのか気になる場合がある. 日本語でPythonであれば一瞬で出来る.
$cat count.py # -*- coding: utf-8 -*- f = open('sv.txt') data = f.read() # counting words = {} for word in list(data): words[word] = words.get(word, 0) + 1 # sort by count d = [(v,k) for k,v in words.items()] d.sort() d.reverse() for count, word in d[:60]: print (count, word)
おまけ
Rust