fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bugfix Tah.after_change signal handler.
[wolnelektury.git]
/
apps
/
lesmianator
/
management
/
commands
/
lesmianator.py
diff --git
a/apps/lesmianator/management/commands/lesmianator.py
b/apps/lesmianator/management/commands/lesmianator.py
index
5412bee
..
b2341ab
100644
(file)
--- a/
apps/lesmianator/management/commands/lesmianator.py
+++ b/
apps/lesmianator/management/commands/lesmianator.py
@@
-3,8
+3,7
@@
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
import re
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
import re
-import sys
-from cPickle import load, dump
+from cPickle import dump
from optparse import make_option
from django.core.management.base import BaseCommand
from optparse import make_option
from django.core.management.base import BaseCommand
@@
-78,7
+77,7
@@
class Command(BaseCommand):
text = unicode(m.group(1), 'utf-8').lower()
for letter in text:
mydict = lesmianator.setdefault(last_word, {})
text = unicode(m.group(1), 'utf-8').lower()
for letter in text:
mydict = lesmianator.setdefault(last_word, {})
- my
val = my
dict.setdefault(letter, 0)
+ mydict.setdefault(letter, 0)
mydict[letter] += 1
last_word = last_word[-2:] + letter
f.close()
mydict[letter] += 1
last_word = last_word[-2:] + letter
f.close()
@@
-99,4
+98,4
@@
class Command(BaseCommand):
dump(lesmianator, open(path, 'w'))
if verbose >= 1:
print "%d processed, %d skipped" % (processed, skipped)
dump(lesmianator, open(path, 'w'))
if verbose >= 1:
print "%d processed, %d skipped" % (processed, skipped)
- print "Results dumped to %s" % path
+ print "Results dumped to %s" % path