-# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
#
import re
from pickle import dump
processed += 1
last_word = ''
- text = str(m.group(1), 'utf-8').lower()
+ text = m.group(1).lower()
for letter in text:
mydict = lesmianator.setdefault(last_word, {})
mydict.setdefault(letter, 0)
return
try:
- dump(lesmianator, open(path, 'w'))
+ dump(lesmianator, open(path, 'wb'))
except IOError:
print(self.style.ERROR("Couldn't write to $s" % path))
return
- dump(lesmianator, open(path, 'w'))
if verbose >= 1:
print("%d processed, %d skipped" % (processed, skipped))
print("Results dumped to %s" % path)