forked from brianvoe/gofakeit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathword_connective.go
161 lines (131 loc) · 5.23 KB
/
word_connective.go
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
package gofakeit
import "math/rand"
// Connective will generate a random connective
func Connective() string { return connective(globalFaker.Rand) }
// Connective will generate a random connective
func (f *Faker) Connective() string { return connective(f.Rand) }
func connective(r *rand.Rand) string {
var connectiveType = map[int]string{
0: "connective_time",
1: "connective_comparative",
2: "connective_complaint",
3: "connective_listing",
4: "connective_casual",
5: "connective_examplify",
}
return getRandValue(r, []string{"word", connectiveType[number(r, 0, 5)]})
}
// ConnectiveTime will generate a random connective time
func ConnectiveTime() string { return connectiveTime(globalFaker.Rand) }
// ConnectiveTime will generate a random connective time
func (f *Faker) ConnectiveTime() string { return connectiveTime(f.Rand) }
func connectiveTime(r *rand.Rand) string {
return getRandValue(r, []string{"word", "connective_time"})
}
// ConnectiveComparitive will generate a random comparative connective
func ConnectiveComparitive() string { return connectiveComparitive(globalFaker.Rand) }
// ConnectiveComparitive will generate a random comparative connective
func (f *Faker) ConnectiveComparitive() string { return connectiveComparitive(f.Rand) }
func connectiveComparitive(r *rand.Rand) string {
return getRandValue(r, []string{"word", "connective_comparitive"})
}
// ConnectiveComplaint will generate a random complaint connective
func ConnectiveComplaint() string { return connectiveComplaint(globalFaker.Rand) }
// ConnectiveComplaint will generate a random complaint connective
func (f *Faker) ConnectiveComplaint() string { return connectiveComplaint(f.Rand) }
func connectiveComplaint(r *rand.Rand) string {
return getRandValue(r, []string{"word", "connective_complaint"})
}
// ConnectiveListing will generate a random listing connective
func ConnectiveListing() string { return connectiveListing(globalFaker.Rand) }
// ConnectiveListing will generate a random listing connective
func (f *Faker) ConnectiveListing() string { return connectiveListing(f.Rand) }
func connectiveListing(r *rand.Rand) string {
return getRandValue(r, []string{"word", "connective_listing"})
}
// ConnectiveCasual will generate a random casual connective
func ConnectiveCasual() string { return connectiveCasual(globalFaker.Rand) }
// ConnectiveCasual will generate a random casual connective
func (f *Faker) ConnectiveCasual() string { return connectiveCasual(f.Rand) }
func connectiveCasual(r *rand.Rand) string {
return getRandValue(r, []string{"word", "connective_casual"})
}
// ConnectiveExamplify will generate a random examplify connective
func ConnectiveExamplify() string { return connectiveExamplify(globalFaker.Rand) }
// ConnectiveExamplify will generate a random examplify connective
func (f *Faker) ConnectiveExamplify() string { return connectiveExamplify(f.Rand) }
func connectiveExamplify(r *rand.Rand) string {
return getRandValue(r, []string{"word", "connective_examplify"})
}
func addWordConnectiveLookup() {
AddFuncLookup("connective", Info{
Display: "Connective",
Category: "word",
Description: "Random connective word",
Example: "such as",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return connective(r), nil
},
})
AddFuncLookup("connectivetime", Info{
Display: "Connective Time",
Category: "word",
Description: "Random connective time word",
Example: "finally",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return connectiveTime(r), nil
},
})
AddFuncLookup("connectivecomparitive", Info{
Display: "Connective Comparitive",
Category: "word",
Description: "Random connective comparative word",
Example: "in addition",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return connectiveComparitive(r), nil
},
})
AddFuncLookup("connectivecomplaint", Info{
Display: "Connective Complaint",
Category: "word",
Description: "Random connective complaint word",
Example: "besides",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return connectiveComplaint(r), nil
},
})
AddFuncLookup("connectivelisting", Info{
Display: "Connective Listing",
Category: "word",
Description: "Random connective listing word",
Example: "firstly",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return connectiveListing(r), nil
},
})
AddFuncLookup("connectivecasual", Info{
Display: "Connective Casual",
Category: "word",
Description: "Random connective casual word",
Example: "an outcome of",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return connectiveCasual(r), nil
},
})
AddFuncLookup("connectiveexamplify", Info{
Display: "Connective Examplify",
Category: "word",
Description: "Random connective examplify word",
Example: "then",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return connectiveExamplify(r), nil
},
})
}