forked from brianvoe/gofakeit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
word_adjective.go
182 lines (149 loc) · 6.1 KB
/
word_adjective.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
package gofakeit
import "math/rand"
// Adjective will generate a random adjective
func Adjective() string { return adjective(globalFaker.Rand) }
// Adjective will generate a random adjective
func (f *Faker) Adjective() string { return adjective(f.Rand) }
func adjective(r *rand.Rand) string {
var adjType = map[int]string{
0: "adjective_descriptive",
1: "adjective_quantitative",
2: "adjective_proper",
3: "adjective_demonstrative",
4: "adjective_possessive",
5: "adjective_interrogative",
6: "adjective_indefinite",
}
return getRandValue(r, []string{"word", adjType[number(r, 0, 6)]})
}
// AdjectiveDescriptive will generate a random descriptive adjective
func AdjectiveDescriptive() string { return adjectiveDescriptive(globalFaker.Rand) }
// AdjectiveDescriptive will generate a random descriptive adjective
func (f *Faker) AdjectiveDescriptive() string { return adjectiveDescriptive(f.Rand) }
func adjectiveDescriptive(r *rand.Rand) string {
return getRandValue(r, []string{"word", "adjective_descriptive"})
}
// AdjectiveQuantitative will generate a random quantitative adjective
func AdjectiveQuantitative() string { return adjectiveQuantitative(globalFaker.Rand) }
// AdjectiveQuantitative will generate a random quantitative adjective
func (f *Faker) AdjectiveQuantitative() string { return adjectiveQuantitative(f.Rand) }
func adjectiveQuantitative(r *rand.Rand) string {
return getRandValue(r, []string{"word", "adjective_quantitative"})
}
// AdjectiveProper will generate a random proper adjective
func AdjectiveProper() string { return adjectiveProper(globalFaker.Rand) }
// AdjectiveProper will generate a random proper adjective
func (f *Faker) AdjectiveProper() string { return adjectiveProper(f.Rand) }
func adjectiveProper(r *rand.Rand) string {
return getRandValue(r, []string{"word", "adjective_proper"})
}
// AdjectiveDemonstrative will generate a random demonstrative adjective
func AdjectiveDemonstrative() string { return adjectiveDemonstrative(globalFaker.Rand) }
// AdjectiveDemonstrative will generate a random demonstrative adjective
func (f *Faker) AdjectiveDemonstrative() string { return adjectiveDemonstrative(f.Rand) }
func adjectiveDemonstrative(r *rand.Rand) string {
return getRandValue(r, []string{"word", "adjective_demonstrative"})
}
// AdjectivePossessive will generate a random possessive adjective
func AdjectivePossessive() string { return adjectivePossessive(globalFaker.Rand) }
// AdjectivePossessive will generate a random possessive adjective
func (f *Faker) AdjectivePossessive() string { return adjectivePossessive(f.Rand) }
func adjectivePossessive(r *rand.Rand) string {
return getRandValue(r, []string{"word", "adjective_possessive"})
}
// AdjectiveInterrogative will generate a random interrogative adjective
func AdjectiveInterrogative() string { return adjectiveInterrogative(globalFaker.Rand) }
// AdjectiveInterrogative will generate a random interrogative adjective
func (f *Faker) AdjectiveInterrogative() string { return adjectiveInterrogative(f.Rand) }
func adjectiveInterrogative(r *rand.Rand) string {
return getRandValue(r, []string{"word", "adjective_interrogative"})
}
// AdjectiveIndefinite will generate a random indefinite adjective
func AdjectiveIndefinite() string { return adjectiveIndefinite(globalFaker.Rand) }
// AdjectiveIndefinite will generate a random indefinite adjective
func (f *Faker) AdjectiveIndefinite() string { return adjectiveIndefinite(f.Rand) }
func adjectiveIndefinite(r *rand.Rand) string {
return getRandValue(r, []string{"word", "adjective_indefinite"})
}
func addWordAdjectiveLookup() {
AddFuncLookup("adjective", Info{
Display: "Adjective",
Category: "word",
Description: "Random adjective",
Example: "genuine",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return adjective(r), nil
},
})
AddFuncLookup("adjectivedescriptive", Info{
Display: "Descriptive Adjective",
Category: "word",
Description: "Random descriptive adjective",
Example: "brave",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return adjectiveDescriptive(r), nil
},
})
AddFuncLookup("adjectivequantitative", Info{
Display: "Quantitative Adjective",
Category: "word",
Description: "Random quantitative adjective",
Example: "a little",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return adjectiveQuantitative(r), nil
},
})
AddFuncLookup("adjectiveproper", Info{
Display: "Proper Adjective",
Category: "word",
Description: "Random proper adjective",
Example: "Afghan",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return adjectiveProper(r), nil
},
})
AddFuncLookup("adjectivedemonstrative", Info{
Display: "Demonstrative Adjective",
Category: "word",
Description: "Random demonstrative adjective",
Example: "this",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return adjectiveDemonstrative(r), nil
},
})
AddFuncLookup("adjectivepossessive", Info{
Display: "Possessive Adjective",
Category: "word",
Description: "Random possessive adjective",
Example: "my",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return adjectivePossessive(r), nil
},
})
AddFuncLookup("adjectiveinterrogative", Info{
Display: "Interrogative Adjective",
Category: "word",
Description: "Random interrogative adjective",
Example: "what",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return adjectiveInterrogative(r), nil
},
})
AddFuncLookup("adjectiveindefinite", Info{
Display: "Indefinite Adjective",
Category: "word",
Description: "Random indefinite adjective",
Example: "few",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return adjectiveIndefinite(r), nil
},
})
}