-
Notifications
You must be signed in to change notification settings - Fork 0
/
generator.py
97 lines (88 loc) · 2.96 KB
/
generator.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
class Generator:
def __init__(self, word, special):
self.special = special
self.word = word
self.reverse = self.word[::-1]
self.capital = self.word.capitalize()
self.upper = self.word.upper()
# Add number behind the word
def first_phase(self, word):
output = []
temp = ''
for i in range(1,2):
temp = word + str(i)
output.append(temp)
for j in range(1, 9):
temp = temp + str(j+1)
output.append(temp)
for i in range(9,8,-1):
temp = word + str(i)
output.append(temp)
for j in range(9, 0, -1):
temp = temp + str(j-1)
output.append(temp)
return output
# Add '@' in between word and numebers
def second_phase(self, word):
output = self.first_phase(word)
at = len(word)
second_output = []
for item in output:
pre = item[0:at]
post = item[at:-1]
combo = pre + '@' + post
second_output.append(combo)
return second_output
# Add '_' in between word and numebers
def third_phase(self, word):
output = self.first_phase(word)
at = len(word)
second_output = []
for item in output:
pre = item[0:at]
post = item[at:-1]
combo = pre + '_' + post
second_output.append(combo)
return second_output
def birthday(self, date):
year = int(str(date)[4:])
output = [str(date), str(date)[::-1]]
for i in range(year-10, year+10):
output.append(self.word+str(i))
output.append(self.word+'@'+str(i))
output.append(self.word+'_'+str(i))
output.append(self.word+str(year))
output.append(self.word+str(str(date)[::-1]))
return output
# Add special characters
def add_special(self):
output = []
with open('special_char.txt', "r") as word_list:
chars = word_list.read().split('\n')
for char in chars:
output.append(self.word+char)
return output
# compile the wordlist
def compiler(self, word):
master = []
first = self.first_phase(word)
second = self.second_phase(word)
third = self.third_phase(word)
fourth = self.add_special()
for words in first:
master.append(words)
for words in second:
master.append(words)
for words in third:
master.append(words)
if self.special == True:
for words in fourth:
master.append(words)
return master
# Put all the words into one list
def result(self):
total = [self.word, self.reverse, self.capital, self.upper]
result = [self.word, self.reverse, self.capital, self.upper]
for item in total:
result += self.compiler(item)
return result