Skip to content

Commit

Permalink
Merge pull request #1 from Zenrac/dev
Browse files Browse the repository at this point in the history
Need test
  • Loading branch information
Zenrac authored Oct 29, 2018
2 parents 80a604e + 9b95dab commit 065e05a
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions TextToOwo/owo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import re
import random

vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
Expand All @@ -14,18 +13,10 @@ def text_to_owo(text):
text = text.replace('L', 'W').replace('l', 'w')
text = text.replace('R', 'W').replace('r', 'w')

while '!!' in text:
text = text.replace('!!', '!')
while '??' in text:
text = text.replace('??', '?')

text = last_replace(text, '!', ' {}'.format(random.choice(smileys)))
text = last_replace(text, '!', '! {}'.format(random.choice(smileys)))
text = last_replace(text, '?', '? owo')
text = last_replace(text, '...', ' UwU')
text = last_replace(text, '.', '. {}'.format(random.choice(smileys)))

text = re.sub('\s\s+', ' ', text) # remove useless space

for v in vowels:
if 'n{}'.format(v) in text:
text = text.replace('n{}'.format(v), 'ny{}'.format(v))
Expand Down

0 comments on commit 065e05a

Please sign in to comment.