Skip to content

Commit

Permalink
wwite the entiwe scwipt
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpyChap committed Mar 29, 2020
1 parent a8a3995 commit 0fd50b5
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 1 deletion.
2 changes: 1 addition & 1 deletion owotext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
__version__ = '1.0.0'

from collections import namedtuple
from .generator import Generator
from .owo import OwO

VersionInfo = namedtuple('VersionInfo', 'major minor micro releaselevel serial')

Expand Down
83 changes: 83 additions & 0 deletions owotext/owo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import random
import argparse

prefixes = [
'<3 ',
'0w0 ',
'H-hewwo?? ',
'HIIII! ',
'Haiiii! ',
'Huohhhh. ',
'OWO ',
'OwO ',
'UwU '
]

suffixes = [
' :3',
' UwU',
' ÙωÙ',
' ʕʘ‿ʘʔ',
' ʕ•̫͡•ʔ',
' >_>',
' ^_^',
'..',
' Huoh.',
' ^-^',
' ;_;',
' ;-;',
' xD',
' x3',
' :D',
' :P',
' ;3',
' XDDD',
', fwendo',
' ㅇㅅㅇ',
' (人◕ω◕)',
'(^v^)',
' Sigh.',
' x3',
' ._.',
' ( \'\')',
' (• o •)',
' (;ω;)',
' (◠‿◠✿)',
' >_<'
]

substitutions = {
'r': 'w',
'l': 'w',
'R': 'W',
'L': 'W',
'no': 'nu',
'has': 'haz',
'have': 'haz',
'you': 'uu',
'the ': 'da ',
'The ': 'Da '
}

class OwO:
def __init__(self, prefixes=prefixes, suffixes=suffixes, substitutions=substitutions):
self.prefixes = prefixes
self.suffixes = suffixes
self.substitutions = substitutions

def whatsthis(self, text: str):
for key, value in self.substitutions.items():
text = text.replace(key, value)
return random.choice(self.prefixes) + text + random.choice(suffixes)

if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='A Python library for converting text strings into OwO',
epilog='https://github.com/DerpyChap/owotext')

parser.add_argument('text', type=str, nargs='+', help='The text to OwO')

args = parser.parse_args()
o = OwO()
text = ' '.join(args.text)
print(o.whatsthis(text))

0 comments on commit 0fd50b5

Please sign in to comment.