Skip to content

Commit

Permalink
key
Browse files Browse the repository at this point in the history
  • Loading branch information
yjqiang committed Nov 3, 2018
1 parent 6bf9a1c commit 4b9f1ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def add_words(match, num=1, word='?'):
new = re.sub('JJ', add_words, new)
new = re.sub('\+V', add_words, new)
new = re.sub('[Pp][^Pp4]{,3}4', lambda match: add_words(match, 4), new)
new = re.sub('[Kk][^Kk]*?[Ee][^Kk]*?[Yy]', lambda match: add_words(match, 7), new)
assert new.replace('?', '') == msg
return new

Expand All @@ -79,7 +80,7 @@ def add_special_str0(self, msg):

def add_special_str1(self, msg):
len_msg = len(msg)
return [f'{msg[:i]}????{msg[i:]}' for i in range(1, len_msg)]
return [f'{msg[:i]}??????{msg[i:]}' for i in range(1, len_msg)]

async def send(self, msg):
print('_________________________________________')
Expand Down

0 comments on commit 4b9f1ce

Please sign in to comment.