26 lines
538 B
Python
26 lines
538 B
Python
SUBSTITUTES = dict(
|
|
l="w",
|
|
r="w",
|
|
L="W",
|
|
R="W"
|
|
)
|
|
|
|
def translate(s,th_to_f=False):
|
|
out = ""
|
|
for i, c in enumerate(s):
|
|
if c in SUBSTITUTES:
|
|
out+=SUBSTITUTES[c]
|
|
else:
|
|
if c=="t": # special case it
|
|
if s[i-1]=="t":
|
|
continue
|
|
elif (i+1)<len(s) and s[i+1]=="t": # tt => dd
|
|
out+="dd"
|
|
elif th_to_f and s[i+1]=="h": # th => f
|
|
out+="f"
|
|
else: out+=c
|
|
elif th_to_f and c=="h" and s[i-1]=="t": continue
|
|
elif c=="o" and s[i-1] in "mn": out+="yo"
|
|
else: out+=c
|
|
return out.replace("ove ","uv ")+" uwu"
|