3 from utilities
import sanitise
5 corpora
= ['shakespeare.txt', 'sherlock-holmes.txt', 'war-and-peace.txt']
6 counts
= collections
.Counter()
9 text
= sanitise(open(corpus
, 'r').read())
12 sorted_letters
= sorted(counts
, key
=counts
.get
, reverse
=True)
14 with
open('count_1l.txt', 'w') as f
:
15 for l
in sorted_letters
:
16 f
.write("{0}\t{1}\n".format(l
, counts
[l
]))