diff options
author | rusinthread <rusinthread@cock.li> | 2017-02-14 17:20:31 +0300 |
---|---|---|
committer | rusinthread <rusinthread@cock.li> | 2017-02-14 17:20:31 +0300 |
commit | 2cd3036adc3568650d910e7ee430c0bce85873ac (patch) | |
tree | 267e026970f87387933668a79e0b0d3db87c7ded | |
parent | 2bf675631511bec3cd7e41dd347523ef59715e0c (diff) |
fix some bugs in util functions
-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] |