#!/usr/bin/env python # coding=utf-8 import random delimiters = (', ', ' - ', '-', '! ', '; ', '. ', '... ', '? ', '?! ', '?? ') eols = ('...', '.', '?', '?!', '??', '!', '') d = lambda: random.choice((' ', random.choice(delimiters))) e = lambda: random.choice(eols) w = lambda: u'хм' + u'м' * random.randint(0, 4) words = ( w() for i in xrange(random.randint(2, 15)) ) print reduce(lambda x,y: d().join((x,y)), words) + e()