diff options
Diffstat (limited to 'util.py')
-rw-r--r-- | util.py | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -75,14 +75,14 @@ for k, v in ENG_FREQ.items(): ENG_FREQ[k] = v/100 -BF_NAMES = ( +BF_NAMES = [ 'марширующе', 'марширующий', 'свободин', 'мовсаев', 'щиголев', 'щиголёв', -) +] def plural(n, words): words = words.split(' ') @@ -214,7 +214,7 @@ def print_hl(s, tohl, end="\n"): i = 0 indexes = [] for c in s: - if c != tohl: + if c.lower() != tohl.lower(): print(c, end='') else: indexes.append(i) @@ -231,10 +231,10 @@ def rot_en(s): s = s.upper() for i in range(0, 26): for letter in s: - if re.match('[\d\.,\_\- ]', letter): + if letter not in alphabet: print(letter, end='') continue - + letter_index = alphabet.index(letter) new_index = (letter_index + i) % 26 new_letter = alphabet[new_index] @@ -248,10 +248,10 @@ def rot_ru(s): s = s.upper() for i in range(0, 33): for letter in s: - if re.match('[\d\.,\_\- ]', letter): + if letter not in alphabet: print(letter, end='') continue - + letter_index = alphabet.index(letter) new_index = (letter_index + i) % 33 new_letter = alphabet[new_index] |