This commit is contained in:
rusinthread 2017-05-19 00:10:02 +03:00
parent d1a8d43887
commit 24f2602711
6 changed files with 28 additions and 31 deletions

View File

@ -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))

View File

@ -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": "?"
},
{

View File

@ -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ТРЕТИЙПОДЪЕЗДВТОРОЙЭТАЖ
> ?

View File

@ -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

View File

@ -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']

37
util.py
View File

@ -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 = []