nivir
8/13/2014 - 11:23 AM

Random Testing code for extract vowel

Random Testing code for extract vowel

__author__ = 'Roy'

def extract_vowels():
    letters = 'abcdefghijklmnopqrstuvwxyz'
    pos = dict(zip(xrange(1, 27), letters))
    print pos
    alphabet = [chr(i) for i in xrange(97, 123)]
    print alphabet
    # generate a list of vowels
    vowels = map(lambda x: chr(x), reduce(lambda acc, i: acc + [acc[-1] + i], (4, 4, 6, 6, 4), [97]))
    print vowels
    codepoints = reduce(lambda acc, i: acc + [acc[-1] + i], (4, 4, 6, 6, 4), [97])
    print codepoints
    consolants = [i for i in alphabet if i not in vowels]
    print consolants
    print pos
    vowlz = map(lambda x: pos[x], reduce(lambda acc, i: acc + [acc[-1] + i], (4, 4, 6, 6, 4), [1]))
    print vowlz
    vowels1 = lambda step, start: map(lambda x: chr(x),
                                      reduce(lambda acc, i: acc + [acc[-1] + i], [4, 4, 6, 6, step], [start]))
    vowels1 = lambda step, start: map(lambda x: chr(x),
                                      reduce(lambda acc, i: acc + [acc[-1] + i], [4, 4, 6, 6, step], [start]))
    vowels1(step=4, start=65)
    print vowels


if __name__ == '__main__':
    extract_vowels()