3 american
= set(open('/usr/share/dict/american-english', 'r').readlines())
4 british
= set(open('/usr/share/dict/british-english', 'r').readlines())
5 cracklib
= set(open('/usr/share/dict/cracklib-small', 'r').readlines())
7 words
= american | british | cracklib
9 # sanitised_words = set()
12 # sanitised_words.add(language_models.sanitise(w))
14 sanitised_words
= set(language_models
.sanitise(w
) for w
in words
)
16 sanitised_words
.discard('')
18 with
open('words.txt', 'w') as f
:
19 f
.write('\n'.join(sorted(sanitised_words
, key
=lambda w
: (len(w
), w
))))