aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrusinthread <rusinthread@cock.li>2017-05-19 00:10:02 +0300
committerrusinthread <rusinthread@cock.li>2017-05-19 00:10:02 +0300
commit24f2602711047289c53315ce8a59afe87db023bf (patch)
tree4b090126f67d0d173f3c944db470f9e822dc9d51
parentd1a8d43887e3a390912c9ed6b82017433b6a565f (diff)
Fix
-rwxr-xr-xanalyze_new.py8
-rw-r--r--data.json2
-rw-r--r--data.md8
-rw-r--r--data_lib.py2
-rwxr-xr-xgen_md.py2
-rw-r--r--util.py37
6 files changed, 28 insertions, 31 deletions
diff --git a/analyze_new.py b/analyze_new.py
index 3999c8c..bfae76c 100755
--- a/analyze_new.py
+++ b/analyze_new.py
@@ -147,12 +147,4 @@ variants = variants[:7]
res = list(itertools.product(*variants))
for r in res:
if r[0] == 'Ь': continue
-# if r[1] != 'А': continue
-# if r[5] != 'Л': continue
-# if r[4] != 'О': continue
-
- #if r[3] != 'И': continue
- #if r[2] != 'Д': continue
- #if r[0] != 'Х': continue
-
print(''.join(r))
diff --git a/data.json b/data.json
index 5c1b905..126f349 100644
--- a/data.json
+++ b/data.json
@@ -928,7 +928,7 @@
"date": "13/2/17",
"source": "fb",
"source_link": "https://www.facebook.com/photo.php?fbid=172247853271471&set=a.100807117082212.1073741826.100014587711024&type=3&theater",
- "type": 4,
+ "type": "2char_rot-3",
"decoded": "?"
},
{
diff --git a/data.md b/data.md
index c9e2944..9fbd895 100644
--- a/data.md
+++ b/data.md
@@ -2403,11 +2403,11 @@
**Источник:** fb, [https://www.facebook.com/photo.php?fbid=172247853271471&set=a.100807117082212.1073741826.100014587711024&type=3&theater](https://www.facebook.com/photo.php?fbid=172247853271471&set=a.100807117082212.1073741826.100014587711024&type=3&theater)
-**Шифровка (тип 4)**:
+**Шифровка (тип 2char_rot-3)**:
> Вшхнуэн гн'кха вр'хра. Кжфхри р'лна фхфтхагн. Кпхри айа фунгх'ни. Кфхтхагн айа р'гнхни. Птхаг'н ар эн гна. Всха р'лна куэн ра. Вуэн ч'хрла ун гз'хра. Хкн амн фшнгни. Фчх'кхн ун гна. Кх'рлни айа р'гзнтха. Кфнгхни айа р'лни. Ктхуэн амн гнхни. Крхна амнхр н'гни. Кпхра р'льни фхфтхфангн. Кпхра фхтунгх фрнгхни. Крн фхтха ун'гна. В'ехн амн тхра. Крхни амн фун'г амн кил. Хдра апр'л нкна. Крнха умн кхрни. В'йерх амн гнхна. В'ёрнх амн гхни. Вжхрн р'лна апрхн. Р'льни афхтн кхна. Вуэн фхртна кх'а кил. Хф'на айа ри л'на. Х'дна авр хн'гни. Фк'хра авл йевл'мни. Фбх'ра авн ф'гхни.
**Расшифровка:**
-> ВЫПИВАЮТСЖЕРТВАМИПРОРВИЩЕПУШКИН
+> ЦЕНТРПСИХУТРОННОГОВОЗДЕЙСТВИЯ
@@ -2671,7 +2671,7 @@
> 9 7 G F 3 < C : J > B D 6 B / K . ?
**Расшифровка:**
-> ЗАМЕЧЕННАУЛИЦЕВОЛКОВА
+> ?
@@ -2707,7 +2707,7 @@
> $ 4 7 6 3 2 - 0 ( 6
**Расшифровка:**
-> ВОЛКОВА7/5ТРЕТИЙПОДЪЕЗДВТОРОЙЭТАЖ
+> ?
diff --git a/data_lib.py b/data_lib.py
index 5015fdc..2f1fa94 100644
--- a/data_lib.py
+++ b/data_lib.py
@@ -225,7 +225,7 @@ def decode_2char_rot_minus3(s):
lines = split_sen(s)
buf = ''
for line in lines:
- line = line.replace(' ', '')
+ line = line.replace(' ', '').replace("'", '')
if re.sub(r'[\.\!\?\\/]', '', line).isdigit():
buf += line
continue
diff --git a/gen_md.py b/gen_md.py
index cb1a8df..7a2428f 100755
--- a/gen_md.py
+++ b/gen_md.py
@@ -67,6 +67,8 @@ def main():
decoded_text = decode_auto(post['text'], cipher_type)
elif cipher_type == '3':
decoded_text = post['decoded']
+ else:
+ decoded_text = '?'
post_buf = ''
post_buf += '**Дата**: %s\n\n' % post['date']
diff --git a/util.py b/util.py
index 0b68a6c..8160a70 100644
--- a/util.py
+++ b/util.py
@@ -180,7 +180,7 @@ def split_sen(s, smart=True):
s = s.strip()
lines = []
- endings = ('. ', '? ', '! ')
+ endings = ('. ', '? ', '! ', '+')
pos = 0
while pos < len(s):
@@ -222,7 +222,7 @@ def split_sen(s, smart=True):
return result_lines
-def analyze_sentences(lines, not_used=False):
+def analyze_sentences(lines, not_used=False, stats=True, space_output=False):
max_len = 0
for line in lines:
if len(line) > max_len:
@@ -236,27 +236,30 @@ def analyze_sentences(lines, not_used=False):
cprint('%2d. ' % i, 'cyan', end='')
- print(line, end='')
- if len(line) < max_len:
- print(' ' * (max_len-len(line)), end='')
-
- cprint(str(len(words)), 'green', attrs=['bold'], end='')
- cprint(' %s,' % plural(len(words), 'word words'), 'green', end='')
+ print(spaceitout(line, 0 if not space_output else 1), end='')
+ if stats:
+ if len(line) < max_len:
+ print(' ' * (max_len-len(line)), end='')
+
+ cprint(str(len(words)), 'green', attrs=['bold'], end='')
+ cprint(' %s,' % plural(len(words), 'word words'), 'green', end='')
- cprint(' %d' % len(line), 'yellow', attrs=['bold'], end='')
- cprint('/', 'yellow', end='')
- cprint('%d' % len(line.replace(' ', '')), 'yellow', attrs=['bold'], end='')
+ cprint(' %d' % len(line), 'yellow', attrs=['bold'], end='')
+ cprint('/', 'yellow', end='')
+ cprint('%d' % len(line.replace(' ', '')), 'yellow', attrs=['bold'], end='')
- cprint(' chars ', 'yellow', end='')
+ cprint(' chars ', 'yellow', end='')
- unique = unique_letters_amount(line)
- cprint('(', 'red', end='')
- cprint(unique, 'red', attrs=['bold'], end='')
- cprint(' unique)', 'red')
+ unique = unique_letters_amount(line)
+ cprint('(', 'red', end='')
+ cprint(unique, 'red', attrs=['bold'], end='')
+ cprint(' unique)', 'red', end='')
i += 1
+ print()
- cprint('Total unique characters: %d\n' % unique_letters_amount(''.join(lines)), 'white', attrs=['bold'], end='')
+ if stats:
+ cprint('Total unique characters: %d\n' % unique_letters_amount(''.join(lines)), 'white', attrs=['bold'], end='')
if not_used:
not_used_list = []