Skip to content

Instantly share code, notes, and snippets.

@jgs03177
Last active December 26, 2024 10:45
Show Gist options
  • Save jgs03177/374df946eb371fcfa634539d63e54884 to your computer and use it in GitHub Desktop.
Save jgs03177/374df946eb371fcfa634539d63e54884 to your computer and use it in GitHub Desktop.
randomstring
import random
cons='bcdfghjklmnpqrstvwxyz_'
vowel='aeiou'
def f(l):
if l<=0:
return ""
c=random.choice(cons)
v=random.choice(vowel)
if c=='_':
c=v
return c+v+f(l-1)
import random
consj='bdghjkmnprstwy_'
vowel='aeiou'
def g(l):
if l<=0:
return ""
c=random.choice(consj)
v=random.choice(vowel)
if c=='_':
c=v
w=c+v
convert={"ti":"tsi", "tu":"tsu", "yi":"", "ye":""}
if w in convert:
w=convert[w]
return w+g(l-1) if len(w) else g(l)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment