-
Notifications
You must be signed in to change notification settings - Fork 2
/
camelipsum.py
73 lines (60 loc) · 2.47 KB
/
camelipsum.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python
#-*-coding: utf-8
# Camel Ipsum Generator
import sys, os, random, argparse
if __name__ != '__main__':
print("Not a module!")
sys.exit(1)
parser = argparse.ArgumentParser(description='To tell me how many paragraphs')
parser.add_argument('length', type=int, help='Paragraph count to generate')
args = parser.parse_args()
PLENGTH = args.length
BASE = ['consectetur', 'adipisicing', 'elit', 'sed', 'do', 'eiusmod', 'tempor',
'incididunt', 'ut', 'labore', 'et', 'dolore', 'magna', 'aliqua', 'ut', 'enim', 'ad',
'minim', 'veniam', 'quis', 'nostrud', 'at', 'exercitation', 'ullamco', 'laboris', 'nisi',
'ut', 'aliquip', 'ex', 'ea', 'commodo', 'consequat', 'duis', 'aute', 'irure',
'dolor', 'in', 'reprehenderit', 'in', 'voluptate', 'velit', 'esse', 'cillum', 'dolore',
'eu', 'fugiat', 'nulla', 'pariatur', 'excepteur', 'sint', 'occaecat', 'cupidatat', 'non',
'proident', 'sunt', 'in', 'culpa', 'qui', 'officia', 'deserunt', 'mollit', 'anim', 'id',
'est', 'laborum']
CAMEL = ['camel', 'arab', 'pyramid', 'sun', 'desert', 'toe', 'hump', 'egypt', 'cornivore', 'two-humped',
'llama', 'alpaca', 'guanaco', 'at', 'muslim', 'brown', 'lady fantasy', 'amber', 'camel light', 'camel soft',
'mammal', 'fat', 'fatty', 'bear grylls', 'kabab']
SENTENCE_LENGTH_MIN = 8
SENTENCE_LENGTH_MAX = 20
STARTS_WITH = "camel ipsum dolor sit ahmet "
def shuffle():
camel_count = len(CAMEL) - 1
for i in range(0, camel_count):
rnd = random.randint(0, camel_count)
BASE.append(CAMEL[rnd])
del(CAMEL[rnd])
camel_count = camel_count - 1
base_count = len(BASE) - 1
for i in range(0, base_count):
rnd = random.randint(0, base_count)
tmp = BASE[i]
BASE[i] = BASE[rnd]
BASE[rnd] = tmp
def merge():
shuffle()
def get_camel_ipsum():
rnd = random.randint(0, len(BASE) - 1)
result = ""
for i in range(0, rnd):
shuffle()
sentence_length = random.randint(SENTENCE_LENGTH_MIN, SENTENCE_LENGTH_MAX)
for i in range(0, sentence_length):
rnd = random.randint(0, len(BASE) - 1)
result += BASE[rnd] + " "
return result
def generate_camel_ipsum():
result = STARTS_WITH
for i in range(0, int(PLENGTH)):
if (i < int(PLENGTH) - 1):
result += get_camel_ipsum() + "\n"
else:
result += get_camel_ipsum()
print(result)
print(">> Camel Ipsum Generator")
generate_camel_ipsum()