MarseyWorld/files/helpers/marsify.py

12 lines
288 B
Python
Raw Normal View History

2022-08-27 02:57:19 +00:00
from .const import marsey_mappings
2022-08-30 12:11:05 +00:00
from random import choice
2022-08-27 02:57:19 +00:00
def marsify(text):
2022-08-30 12:11:05 +00:00
new_text = ''
for x in text.split(' '):
new_text += f'{x} '
2022-09-01 22:38:33 +00:00
x = x.lower()
if len(x) > 4 and x in marsey_mappings:
2022-08-30 12:11:05 +00:00
marsey = choice(marsey_mappings[x])
new_text += f':{marsey}: '
return new_text