Name: Anonymous 2008-08-04 18:16
e.g. http://tech.slashdot.org/comments.pl?sid=634587&cid=24460893&threshold=-1&no_d2=1&mode=nested
Anyone got any source code for these?
Anyone got any source code for these?
from random import choice,randint
def randsent(x,f):
"""x-number of words,f-maximum number of syllables"""
pbal='bcdfghjklmnpqrstvwxyz'
bal='aeiou'
l=['110','10']
c=[]
z=''
for i in range(x):
for y in range(randint(1,f)):
q=choice(l)
for i in q:
if i=='0':
z+=choice(bal)
else:
z+=choice(pbal)
if y==0:
z=z.capitalize()
c.append(z)
z=''
r=' '.join(c)
return r+'.'
from random import choice,randint
def randsent(x,f):
"""x-number of words,f-maximum number of syllables"""
pbal='bcdfghjklmnpqrstvwxyz'
bal='aeiou'
l=['110','10']
c=[]
z=''
for i in range(x):
for y in range(randint(1,f)):
q=choice(l)
for i in q:
if i=='0':
z+=choice(bal)
else:
z+=choice(pbal)
if i==0:
z.capitalize()
c.append(z)
z=''
r=' '.join(c)
return r+'.'